views:

665

answers:

2

I'm trying to add an element to an array only if it doesn't already exist in the array. I used to do this with the Array.include method of mootools, but now I'm using jquery.

Is there a method to do this in jquery?

http://mootools.net/docs/Native/Array#Array:include

A: 

Removing my stupid answer...

As a general rule, I recommend using jQuery Documentation and jQuery API browser

Vincent Robert
That's not really what I had in mind.
leeand00
Oops, sorry about this one, answered too fast
Vincent Robert
+1  A: 

Nevermind, I found it...

jQuery.unique();

http://docs.jquery.com/Utilities/jQuery.unique#array

leeand00
Ah yeah, me too removing my stupid answer...
leeand00