Miscellaneous Operators
JavaScript Operators
Some Miscellaneous JavaScript Operators are described below.
| Operator | Name / Link | Example |
|---|---|---|
| : | Colon | age : 45 |
| . | Property Access | person.age |
| [ ] | Property Access | person["age"] |
| [ ] | Array Literal | cars = ["Saab", "Volvo", "BMW"] |
| { } | Object Literal | car = {type:"Fiat", model:"500"} |
| ?. | Optional Chaining | x ?. y |
| ... | Spread | ...myArray |
| ( ) | Grouping | ( x + y ) |
| ( ) ? x : y | Ternary Conditional | (z < 18) ? x : y |
| ( ) | Invocation | myFunction() |
| => | Arrow Function | (a, b) => a + b |
| new | Constructor | new Date() |
| delete | Delete | delete person.age |
| in | Relational in | "age" in person |
| instanceof | Instance of | x instanceof Array |
| typeof | Type of | typeof "John" |
| void | Void | void(0) |
| yield | Delegate | yield.x |