Javascript like a PRO

Justin Lee
Aug 3, 2021
javascript like a pro

There are 5 tips that you want to know to be a pro.

  1. Ternary Operator

2. Nullish Operator

3. OR Operator

Find whether it isfalsy . If it is, then return the right expression.

4. Spread Syntax

By using Spread syntax, you are not only enhancing readability but also preventing side effects.

When you were to pass the original array to the parameter, it could possibly mutate your original array in the function.

5. Enum

By using Enum, you can handle human error. You or others can easily misspell the name of the colour.

Maybe you are not the person who is making spelling mistakes, but it is more readable when you use Enum.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Justin Lee
Justin Lee

Written by Justin Lee

Software Engineer at Loblaw Digital

No responses yet

Write a response