UNPKG

476 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.getFirstArrayDuplicate = void 0;
4function getFirstArrayDuplicate(array) {
5 const seenValues = new Set();
6 for (const entry of array) {
7 if (seenValues.has(entry)) {
8 return entry;
9 }
10 else {
11 seenValues.add(entry);
12 }
13 }
14 return undefined;
15}
16exports.getFirstArrayDuplicate = getFirstArrayDuplicate;
17//# sourceMappingURL=js.js.map
\No newline at end of file