DEV Community

loading...

Discussion on: Optional Chaining in javascript.

Collapse
amitavmishra99 profile image
Amitav Mishra

Just to add (?.) is also called Elvis operator. Anyway great content. One quick suggestion - add syntax highlighting using markdown.
github.com/adam-p/markdown-here/wi...

Collapse
lakshaykalra profile image
Lakshay Kalra Author

Correct me if I'm wrong, I think elvis operator is "? :" Which is also called ternary operator in JS.

Check out this link.

en.m.wikipedia.org/wiki/Elvis_oper...

Collapse
amitavmishra99 profile image
Amitav Mishra

Well some links say "?:" is elvis operator and some says "?."
After few research I found Elvis operator is "?:" and "?." is actually Safe Navigation operator. Thanks for reminding :)

Link that says "?." is elvis operator ->
joshmorony.com/safely-displaying-d...

Some stackoverflow discussion ->
stackoverflow.com/questions/440469...