Unused JavaScript Operators

Swaroop Koshy Mathew
2 min readMar 20, 2021

Even though we have worked with JS, there are certain powerful operators that are unknown or not used. Lets have a look at these 4 JavaScript operators that you might not have never heard of.

  1. ?? Operator
    The Nullish Coalescing Operator is a logical operator that handles nullable scenarios. It returns the right hand side operand when its left hand side operand is null or undefined. If the left hand side operand is not null or undefined, it returns the left hand side operand.

2. ??= Operator
The Nullish Assignment (x??=y)Operator only assigns if x is null or undefined.

3. ??. Operator
The Optional Chaining Operator functions similarly to the . Chaining Operator, except that instead of causing an error if a reference is nullish (null or undefined).

4. ? Operator
The ternary operator ? takes three operands: a condition, an expression to execute if the condition is true, and an expression to execute if the condition is false.

Hope you have enjoyed, you can reference more operators and inbuilt functions at the link provided below in the reference.

Happy Coding 😊

References
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators

--

--