JavaScript Array: get "range" of items

Viewed 128026

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']
4 Answers
Related