F
F
frontend332018-03-13 08:14:13
JavaScript
frontend33, 2018-03-13 08:14:13

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

1 answer(s)
A
Alexey Ukolov, 2018-03-13
@frontend33

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 question

Ask a Question

731 491 924 answers to any question