Imagine having the following array:
[{k:2, v:"Stack"}, {k:5, v:"Over"}, , {k:9, v:"flow"}]
Is there a way to select elements based on certain criteria without using a traditional for/foreach loop? For example, can I select all keys with values less than or equal to 5, extract the first 2 elements, or gather all values associated with odd-numbered keys (to spell "Overflow")?
I'm searching for something similar to jQuery's functionality, where actions can be applied to all matching elements. Like how this code snippet adds the 'newclassproperty' class to all link elements within a div with the group class:
$('.group a').addClass('newclassproperty')