DEV Community 👩‍💻👨‍💻

Ega Prasetya
Ega Prasetya

Posted on

Shorthand Javascript Techniques

Declaring Variables

Alt Text

Ternary Operators

Alt Text

Assignment Operators

Alt Text

Switch Case

Alt Text

If Presence

Alt Text

Arrow Functions

Alt Text

Object Array Notation

Alt Text

Happy Coding!

Top comments (2)

Collapse
jaca22 profile image
Jacek Dunikowski • Edited on

Ternary Operators:

// SHORTHAND
let number = x > 9 ? true : false;

Even more shorthand:

// SHORTHAND
let number = x > 9;
Collapse
egaprsty profile image
Ega Prasetya Author

Ah, this is also very cool bro. Nice comment!

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.