From 8eca0e5f25ba10f55eddf4350b2a27b4ced88c3e Mon Sep 17 00:00:00 2001 From: Manish Date: Wed, 23 Aug 2023 11:16:07 +1000 Subject: [PATCH] Data Structures: Remove items from a set in ES6 --- Data Structures/es6SetDelete.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Data Structures/es6SetDelete.js diff --git a/Data Structures/es6SetDelete.js b/Data Structures/es6SetDelete.js new file mode 100644 index 0000000..e280de9 --- /dev/null +++ b/Data Structures/es6SetDelete.js @@ -0,0 +1,10 @@ +// https://www.freecodecamp.org/learn/coding-interview-prep/data-structures/remove-items-from-a-set-in-es6 + +function checkSet() { + // Only change code below this line + var set = new Set([1, 2, 3, 4, 5]); + set.delete(2); + set.delete(5); + // Only change code above this line + return set; +}