vendredi 2 décembre 2016

Random number to Array

I wish to learn a way to take a var which is assigned a random number through Math.random, and split that var into and array that I can Iterate through and manipulate.

The code bellow was my best guess. I don't understand why the .split() isn't working here. Thank you for helping.

    var myRandomNum = Math.random();
    var myRandomArray = myRandomNum.split(","); 
    console.log(myRandomArray); 




Aucun commentaire:

Enregistrer un commentaire