Skip to content

re: 9 Extremely Powerful JavaScript Hacks VIEW POST


Useful examples 👍

The word hacks makes me feel you write about dirty shortcuts, but these are actually absolutely good solutions to every-day problems. I wouldn't call them hacks.


Eh.. I wouldn't use most of them in production code (like shortcutting over using an if statement).


Probably not in a class or function, but it's super useful in template code or jsx when you are in need of a terse expression, such as to say 'if object exists, render'... user &&, etc

Leave terse to compilers unless it makes your expression more clear.


Thank you.
You do have a fair point.
But any word I thought of (tricks, shortcuts, etc) felt like a synonym for "cutting corners".

code of conduct - report abuse