array.findAll()
These functions searches the array for the specified object and return the positions of all occurrence of this values.
array.findAll( value_or_closure=any )
Returns: Array
Examples
numbers = [ "one", "two", "three", "four", "one", "one", "two", "one" ];
dump( numbers.findall( "one" ) ) ; // [ 1,5, 6, 8 ]
<span class="nv">fruits</span> <span class="o">=</span> <span class="p">[</span> <span class="s2">"apple"</span><span class="p">,</span> <span class="s2">"orange"</span><span class="p">,</span> <span class="s2">"banana"</span><span class="p">,</span> <span class="s2">"orange"</span><span class="p">,</span> <span class="s2">"orange"</span> <span class="p">];</span>
<span class="nf">dump</span><span class="p">(</span> <span class="nf">fruits.findall</span><span class="p">(</span> <span class="s2">"orange"</span> <span class="p">)</span> <span class="p">);</span> <span class="c">// [ 2, 4, 5 ]</span>
<span class="nv">notOranges</span> <span class="o">=</span> <span class="nf">arrayFindAll</span><span class="p">(</span> <span class="nv">fruits</span><span class="p">,</span>
<span class="nf">function</span><span class="p">(</span> <span class="nv">el</span> <span class="p">){</span>
<span class="nv">return</span> <span class="nv">arguments.el</span> <span class="nv">neq</span> <span class="s1">'oranges'</span><span class="p">;</span>
<span class="p">});</span>
<span class="nf">dump</span><span class="p">(</span> <span class="nv">notOranges</span> <span class="p">);</span> <span class="c">// [ 1, 3 ]</span>