I know another easy way to do this with only one loop but not in jquery way.
var arrayA=[1,2,3,4,5]
var arrayB=[1,b,c,1,2]
for(var i=0;i
>
>> From: Potluri
>>
>> Is there a jquery way to compare two arrays without looping.
>>
>> like I have an array1 [a,b,1,2,3]
>> and array2 [b,c,d,11 ].
>>
Map and reduce iterate over the array as well so the only speedup
you'd gain from using them is the fact that they're natively
implemented and not written in JavaScript themselves. They still
represent functions that loop over arrays.
On Aug 29, 7:12 am, "Sean Catchpole" <[EMAIL PROTECTED]> wrote
This can be done using map&reduce or other functions, but they are only
supported in Firefox atm.
Writing a double for loop is easy to code and wider supported.
~Sean
On 8/28/07, Potluri <[EMAIL PROTECTED]> wrote:
>
>
>
> Is there a jquery way to compare two arrays without looping.
>
> like I hav
> From: Potluri
>
> Is there a jquery way to compare two arrays without looping.
>
> like I have an array1 [a,b,1,2,3]
> and array2 [b,c,d,11 ].
>
> Is there a way like array1.compare(array2). which returns
> true if atleast one element among the 2 arrays matches.
Somebody has to loop, whethe
4 matches
Mail list logo