DEV Community

loading...

Discussion on: 7 Javascript Tips and Tricks

Collapse
misobelica profile image
Mišo

Hi, while the conversion hacks are interesting, PLEASE note in bold (as with Math.*) that proper readable methods should be used. It's really cryptic in the real life code to decode these tricks because people think this is the only and proper way instead of these:

const isFalse = Boolean(0);
const numeric = String(29);
const integer = Number("36");  // or better parseInt("36", 10)
Collapse
ga profile image
Ega Prasetya Author

nice corrections, thank you.