Post

Code Chronicles Hub
Code Chronicles Hub@codechronHub·
Most developers know that NaN === NaN returns false in JavaScript. What do you think the output of this code will be? const mySet = new Set(); mySet.add(NaN); mySet.add(NaN); mySet.add('NaN'); console.log(mySet.size); // ??
English
1
0
4
35
Code Chronicles Hub
Code Chronicles Hub@codechronHub·
🤔 Which option did you choose and why? Drop your reasoning in the comments!👇 Sets use a different equality algorithm internally! 🎥 Watch the full breakdown along with the snippets from the actual internal algorithm used by JavaScript 👉youtube.com/shorts/fPR7nRb…
YouTube video
YouTube
English
0
0
2
15
Paylaş