0
Can I get an array of 10 figure numbers using Javascript from 1? so that I can manipulate the array ? If yes how can I ?
3 Respuestas
+ 6
If I got this right you want an array that starts from 1 and goes up to 9,999,999,999.
It certainly is possible to create such a huge array with a simple for loop. But it will be slow.
Let arr = [];
for(let i=0; i<9999999999; i++) {
arr.push(i);
}
Why would you need such a huge array anyway?
You may want to look into sparse arrays if your array will be mostly empty (contains a lot of zeros) because they are significantly faster.
https://en.m.wikipedia.org/wiki/Sparse_matrix
+ 2
Posted twice 👇
https://www.sololearn.com/Discuss/2391603/?ref=app
0
Haris , Sandeep Kushwaha, shubham28, ★ Don’t Know ★, Franck Pertinent, Mirielle [INACTIVE], RAM PAL can any one of you can please help us?