Optional Chaining not supported?

Problem description:
Can’t use obj?.a?.b syntax

Expected behavior:

Actual behavior:

Steps to reproduce:

Bug appears at this link:


That’s a limit of your language, not Replit

1 Like

No, it is supported in nodeJS.

I think I discovered the issue. I believe the “lite” version is not supporting it.
Once I signed up and setup my own replit, it works fine.


Possibly you were using an outdated version of Node

1 Like

Thanks, but no.

Using this link… https://replit.com/languages/nodejs
and selecting Node.js I get this error…

let exist = obj?.a?.z
SyntaxError: Unexpected token ‘.’

However, once I signed up and used my accounts replit, it worked as expected and I got this result…


Here is the code…

let obj = {“a”: 1, “b”: 2}
let exist = obj?.a?.z

That line was the only thing in your file?