Don’t believe me? Test it yourself (paste into Chrome Dev Tools and click run):
12 Good JavaScript Shorthand Techniques
Yuri Ramos
1.2K59

This can be problematic if you don’t know your input ranges and types. If variable1 is 0, then it sets variable2 to empty string, which may not be desired. Use this shorthand with caution.

Like what you read? Give Alvin Lin a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.