Am 13.05.2007 um 06:23 schrieb Kickboy:

>
> First off, I've really enjoyed using the Prototype framework. It's
> really well done. Kudos to all the programmers involved.
>
> Now, here's what I'm posting about...
>
> I've come across a function for Arrays that I've found rather useful,
> and I think others would as well; Array.compare().
>

Here's an implementation based on the unit test code Mislav mentioned:

Array.prototype.equal = function(array){
   return (this.length == array.length) &&
     !this.zip(array).any( function(item){
       return item[0] != item[1];
     });
}

best,
Thomas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to