j0hnik,
<script>
function fn(b) {
for (var c = [], a = 0; a < b.length; a++) c[b[a]] = true;
b = [];
for (a = 1; a < c.length; a++) c[a] || b.push(a);
return b
};
var a = [8, 10, 11, 7, 3, 15, 6, 1, 14, 5, 12] ;
a = fn(a);
document.write(JSON.stringify(a, null, 4))
</script>