Hey there π
I've spent a lot of time learning the details of JavaScript and stumbled across lots of surprising gotchas that only became clear after understanding what's going on under the hood.
I plan to post one of these each day (or so) and would love to get discussions around the specific "problems".
Here's the first: What's the result?
const num = '5';
console.log("5" * 4 + num);
- Error
- 25
- 205
- 55555
Easy, right :)
.. said some of my coworkers, before getting it wrong π€
Top comments (0)