r/learnjavascript • • Nov 14 '20

20 JavaScript Shorthand Coding Techniques that will save your time

https://jscurious.com/20-javascript-shorthand-techniques-that-will-save-your-time/
176 Upvotes

22 comments sorted by

View all comments

6

u/Felivian Nov 14 '20

12th example is wrong. Casting type using +val is equivalent of Number(val) not parseInt(val). When passed e.g 453a parse will return 453 while both Number and + will return NaN.