DEV Community

Discussion on: Javascript Interview Questions : Optional chaining (?.)

Collapse
 
xr0master profile image
Sergey Khomushin

The second question is relevant if you are looking for a history teacher. No, seriously, what are you checking here? But we can take this topic and ask how to implement the optional chaining operator logic on older versions.

Collapse
 
jlitowitz profile image
Jason Litowitz

Knowing in which version the operator got introduced is useful to more than just a history teacher. For example, say you take over a system running Node 12. That doesn't run ECMAScript 2020, so using this operator would break. This is a brand new operator, so until the supporting runtime is guaranteed - or at least, a likelihood - it's important to know such details. At a minimum, for such a new operator, you should be able to answer, "a really recent version".

Collapse
 
xr0master profile image
Sergey Khomushin

I doubt you check every feature, is there any support for your engine? Everyone should mind their own business, and for this there are compilers. I suggest you get to know Babel.