Problem description:
Can’t use obj?.a?.b syntax
Expected behavior:
Actual behavior:
Steps to reproduce:
Bug appears at this link:
Browser/OS/Device:
Problem description:
Can’t use obj?.a?.b syntax
Expected behavior:
Actual behavior:
Steps to reproduce:
Bug appears at this link:
Browser/OS/Device:
That’s a limit of your language, not Replit
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.
Thanks.
Possibly you were using an outdated version of Node
Thanks, but no.
Using this link… https://replit.com/languages/nodejs
and selecting Node.js I get this error…
/home/runner/req7g76hjf9/index.js:2
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…
undefined
Here is the code…
let obj = {“a”: 1, “b”: 2}
let exist = obj?.a?.z
console.log(exist)
That line was the only thing in your file?