diff --git a/Data Structures/es6SetHasAndSize.js b/Data Structures/es6SetHasAndSize.js new file mode 100644 index 0000000..d4e1e39 --- /dev/null +++ b/Data Structures/es6SetHasAndSize.js @@ -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 +}