Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkIfNoSameElementExistInArray = void 0;
var checkIfNoSameElementExistInArray = function (_array) {
//return false if any overlapped value exist.
//return true if no same element exists.
var arrayLen = _array.length;
var set = new Set(_array);
var setLen = set.size;
return arrayLen === setLen;
};
exports.checkIfNoSameElementExistInArray = checkIfNoSameElementExistInArray;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment