Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!arrayToCheck || !Array.isArray(arrayToCheck)) {
- throw new TypeError('Array expected but ' +
- typeof arrayToCheck + ' found.');
- }
- if (!Array.isArray(arrayToCheck)) {
- throw new TypeError(`Array expected but ${typeof arrayToCheck} found.`);
- }
- return arrayToCheck.filter((e, i, arr) => i === arr.indexOf(e));
- function removeDuplicates(array) {
- 'use strict';
- if (!Array.isArray(array))
- throw new TypeError(`Array expected but ${typeof array} found.`);
- return array.filter((e, i, arr) => i === arr.indexOf(e));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement