DEV Community

Discussion on: 😰 Optional chaining trap !

Collapse
 
devinrhode2 profile image
Devin Rhode

At the end of the day I think I would prefer to use a simple Object.prototype.lookup method that automatically console.log's the message I described.

Thread Thread
 
devinrhode2 profile image
Devin Rhode • Edited

One issue is that passing an object lookup path as a string results in no syntax highlighting, you probably lose out on a bunch of other potential ide goodies, but from what I know they mostly don't apply to the main use case of check data from the user or from over the wire.