From 81a9baedd0c2e463caa85d2161bb0e548857ee66 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Sat, 23 Sep 2023 14:03:55 +0600 Subject: [PATCH] fix: set example --- src/data/question-groups/javascript/content/set.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/data/question-groups/javascript/content/set.md b/src/data/question-groups/javascript/content/set.md index cd9a1cab7..113268a13 100644 --- a/src/data/question-groups/javascript/content/set.md +++ b/src/data/question-groups/javascript/content/set.md @@ -3,12 +3,15 @@ Set is another data structure in JavaScript which is similar to `Array` but the ```js const roadmap = new Set(); roadmap.add('JavaScript'); +roadmap.add('JavaScript'); + roadmap.add('dynamic'); roadmap.add(1995); +console.log(roadmap.size); // 3, because the value 'JavaScript' is already present in the set console.log(roadmap.has('JavaScript')); // true -roadmap.delete(1995); -console.log(roadmap.has(1995)); // false +roadmap.delete('JavaScript'); +console.log(roadmap.has('JavaScript')); // false console.log(roadmap.size); // 2 ```