[1] != [1]
On Tue, Jul 7, 2009 at 8:08 AM, Ryan Florence (via Nabble) <
[email protected]<ml-user%[email protected]>
> wrote:
>
> *shouldn't allow* is what I meant.
>
> I even found this
>
> Array.prototype.unique = function () {
> var r = new Array();
> o:for(var i = 0, n = this.length; i < n; i++)
> {
> for(var x = 0, y = r.length; x < y; x++)
> {
> if(r[x]==this[i])
> {
> continue o;
> }
> }
> r[r.length] = this[i];
> }
> return r;
> }
>
> and gave it a shot and still get the duplicates. Certainly there's
> something I'm misunderstanding about arrays.
>
> On Jul 7, 8:58 am, Ryan Florence
> <rpflore...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3219839&i=0>>
> wrote:
> > I've got some code that is using include() but it's kicking our arrays
> > that look like this:
> >
> > [[4, 3], [4, 4], [3, 1], [3, 2], [3, 2], [2, 0], [2, 1], [2, 1], [2, 1]]
> >
> > When I'd expect
> >
> > [[4, 3], [4, 4], [3, 1], [3, 2], [2, 0], [2, 1]]
> >
> > Any idea why? Here's the code:http://paste.mootools.net/m29973258
>
>
> ------------------------------
> View message @
> http://n2.nabble.com/-Moo--arr.include%28%29-should-allow-duplicates%2C-right--tp3219766p3219839.html
> To start a new topic under MooTools Users, email
> [email protected]<ml-node%[email protected]>
> To unsubscribe from MooTools Users, click here< (link removed) >.
>
>
>
-----
The MooTools Tutorial: http://www.mootorial.com www.mootorial.com
Clientcide: http://www.clientcide.com www.clientcide.com
--
View this message in context:
http://n2.nabble.com/-Moo--arr.include%28%29-should-allow-duplicates%2C-right--tp3219766p3219882.html
Sent from the MooTools Users mailing list archive at Nabble.com.