Method Array.unique
Remove any duplicates from an array
-
Syntax
Array Array.unique()
This function will return a new array with duplicates of the original array removed - Return value A new array with no duplicates
-
Examples
- To remove the duplicates in the array (0,2,4,2,6,4,8,6,10);
// Define array var a = new Array(0,2,4,2,6,4,8,6,10); // Output is (0,2,4,8,6,10) a.unique();
-
Download
Source
Unless otherwise noted all code in the JSLab Standard Library is licensed as GPLv3. See http://www.gnu.org/licenses/gpl.html for the entire license.
