I think my problm is quite simple, but I don't think I've found a way to make it work.
My goal is to :
let winX = ['X', 'X', 'X']
I tried doing this with :
let winX = [
function () {
for (let index = 0;index < cells_in_line;index++) {
winX.push('X');
}
return winX;
}
];
But a call to the console says it's undefined.
Is there a way to generate an array depending on certain variables with a function expression and a loop?