You could use ts-optchain, which provides a similar approach using Proxy, but the syntax is actually:
// object?.foo?.bar?.foobar ?? "dafault value"
Nice one! Thanks for sharing!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.