Answer the question
In order to leave comments, you need to log in
There is an integer 6 how to get a list from it?
For example, there is an array var NumberRandom=array.length where
array.length is 6
I want to get all indices starting from 0 to 5
How can I get a list of indices (0,1,2,3,4,5)?
Answer the question
In order to leave comments, you need to log in
In modern js , you can do this:
Or like this, since you initially have an array:
Or even just like this:Object.keys(arr);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question