DEV Community

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
 
egaprsty profile image
Ega Prasetya

nice corrections, thank you.