Data Structures: Use .has and .size on an ES6 Set
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user