freeCodeCamp Challenge Guide: Use .has and .size on an ES6 Set

Use .has and .size on an ES6 Set


Solutions

Solution 1 (Click to Show/Hide)
function checkSet(arrToBeSet, checkValue){
  // Only change code below this line
  const newSet = new Set(arrToBeSet);
  return [newSet.has(checkValue), newSet.size]
  // Only change code above this line
}
1 Like