If I have an array and want to select non-consecutive elements, such as the second and fifth elements, is there a simple method to do this? For example:
a = ["a","b","c","d","e"]
a.select_elements([1,4]) // should yield ["b","e"]
EDIT:
After some reflection, I realized that using
[1,4].map(function(i) {return a[i]})
works. But, is there a more concise way to achieve this?