Search code examples
jqueryarraysincludemootools

What is the jQuery equivalent of mootools Array.include()?


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


Solution

  • Nevermind, I found it...

    jQuery.unique();

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