+ 2
how can I choose 2 random elements and change there value from no thing (undefined) to number (2 or 4) by JavaScript jQuery
i wanna make game 2048
2 Answers
+ 4
var twoOrFour = Math.floor(Math.random()*2) ? 2:4;
console.log(twoOrFour);
https://code.sololearn.com/WiI2yQ0pQoQJ/?ref=app
+ 1
CalviŐ˛ can you explain more
by document elements