Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4631

JavaScript Array: get "range" of items

$
0
0

Is there an equivalent for ruby's array[n..m] in JavaScript?

For example:

>> a = ['a','b','c','d','e','f','g']>> a[0..2]=> ['a','b','c']

Viewing all articles
Browse latest Browse all 4631

Latest Images

Trending Articles



Latest Images