Quantcast
Channel: User Mohamed Mufeed - Stack Overflow
Viewing all articles
Browse latest Browse all 37

Answer by Mohamed Mufeed for Array item gets the value "undefined"

$
0
0

You can also do this without Set

eg:

var numbers = [];var rand;while(numbers.length < 10){    rand = Math.floor(Math.random()*10);    numbers.indexOf(rand) === -1 && numbers[numbers.length] = rand;}console.log(numbers);

Viewing all articles
Browse latest Browse all 37

Trending Articles