array-norepeat

0.0.2 • Public • Published

array-norepeat

return an array that removing duplicate elements of the given array, still keep the order of the elements.

Install

npm install array-norepeat

Usage

var norepeat = require('array-norepeat');
norepeat(array[, deepEqual])

NB: if you set deepEqual true, norepeat will use === to compare two element, otherwise use ==. default true.

Example

var norepeat = require('array-norepeat');

var arr = [1, 2, "1", "2", 1, 2, "1", "2"];

console.log("deepEqual(default): %j", norepeat(arr));
//=> [1, 2, "1", "2"]
console.log("deepEqual:          %j", norepeat(arr, true));
//=> [1, 2, "1", "2"]
console.log("No deepEqual:       %j", norepeat(arr, false));
//=> [1, 2]

License

MIT

/array-norepeat/

    Package Sidebar

    Install

    npm i array-norepeat

    Weekly Downloads

    2

    Version

    0.0.2

    License

    MIT

    Last publish

    Collaborators

    • nswbmw