Tell us what’s happening:
I don’t understand what I am wrong. what is the outcome of the result.
Your code so far
function getFinalOpenedDoors(numDoors) {
// Good luck!
var arr = [...Array(numDoors).keys()]
.fill(false);
for(var i = 1; i <= numDoors; i++){
arr = arr.map((x, j) => {
if(j % i === 0)
return !x;
else
return x;
});
}
return arr;
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:74.0) Gecko/20100101 Firefox/74.0
.
Challenge: 100 doors
Link to the challenge: