Dlaczego poniższy kod zwraca [1, 1, 1, 1, 16, 32, 64, 128] zamiast [1, 2, 4, 8, 16, 32, 64, 128]
const x = Array(8).fill(1);
const xpos = Array(8).fill(0);
for (let i = 0; i < x.length; i++) {
xpos[x.length - 1 - i] = Number(x[i]);
xpos[i] = Math.pow(xpos[i] * 2, [i]);
}
console.log(xpos) // [1, 1, 1, 1, 16, 32, 64, 128]