JavaScript Set size with 0, -0, +0 values

JavaScript question 🧠 What will this log? Think before running it. const values = [ 0, -0, +0 ]; const set = new Set( values ); console.log( set.size ); A) 1 B) 2 C) 3 Are 0, -0, and +0 treated as different values? Or does Set see them as the same? #JavaScript #CodingChallenge #Frontend

  • graphical user interface, text

Me: three values. JavaScript Set: I see ONE. Result → 1 🤯

Like
Reply
See more comments

To view or add a comment, sign in

Explore content categories