JQuery Array unique

From CoderLearner
Jump to: navigation, search

jQuery Eliminate Duplicated Array Element

Uses $.unique() function to eliminate all duplicated elements.

Syntax $.unique()

 
$.unique(array);

Example

$(document).ready(function() {
	var myList = [3,4,5,23,4,51];
	$.unique(myList);
	alert(myList.length);
});

Output

5