Data Structures: Use .has and .size on an ES6 Set

This commit is contained in:
Manish 2023-08-23 11:19:19 +10:00
parent 8eca0e5f25
commit 0973091ac5

View File

@ -0,0 +1,8 @@
// https://www.freecodecamp.org/learn/coding-interview-prep/data-structures/use--has-and--size-on-an-es6-set
function checkSet(arrToBeSet, checkValue) {
// Only change code below this line
const set = new Set(arrToBeSet);
return [set.has(checkValue), set.size];
// Only change code above this line
}