Yogesh B C’s Post

🚀 Day 22 - Poll answer & Explanation const map = new Map(); map.set("a", 1); map.set("b", 2); const set = new Set([1, 2, 3, 3]); console.log(map.size, set.size); 2 3  Explanation (simple & clear):  - Map stores key-value pairs → "a" and "b" → size = 2  - Set stores only unique values → duplicates removed  - [1, 2, 3, 3] → becomes [1, 2, 3] → size = 3  Key Point:  - Map counts unique keys  - Set automatically removes duplicate values  Output:  2 3 #JavaScript #JSInterview #FrontendDevelopment #WebDevelopment  #CodingChallenge #JSConcepts #Developers #Programming  #TechInterview #LearnJavaScript #100DaysOfCode #CodeNewbie  #SoftwareDevelopment #CodingTips #JSBasics #DevelopersLife

To view or add a comment, sign in

Explore content categories