Hey guys👋 JavaScript is no doubt one of the coolest and currently the trendiest language in the world that is gaining more and more popularity every day. Therefore, I thought, why not write about it, so here I am! In this article, I have compiled a ...

Markdown supported · ⌘↵ to post
Ayesha Sahar
for the second one you could use string interpolation instead of adding a + "", looks a bit cleaner :D
Nice tips and tricks . Knew almost all of them . But that is because I am working with JS for quite some time. This is really helpful for a beginner.
CONVERT TO NUMBER
let int = +"16";
console.log(int); // Output: 16 console.log(typeof int);
Thanks for sharing, some of them are useful in a few situations.
However I would not advise people to use some of this tricks, especially the hacky conversion ones.
Those would make the code "short", but definitely not "clean".
For clean code, write code using well-known features of the language.
Also I'd rather read a code a few lines longer, than an incomprehensible, or over-smart 1-liner.
Again, thanks for sharing, just giving a different perspective.
Joseph Pham
Software Engineer
extremely useful