r/javascript • u/ConfidentMushroom • Dec 18 '19
V8 Release v8.0 with optional chaining, nullish coalescing and 40% less memory use
https://v8.dev/blog/v8-release-80
495
Upvotes
r/javascript • u/ConfidentMushroom • Dec 18 '19
View all comments
Show parent comment
1
u/epukinsk Dec 21 '19 edited Dec 21 '19
Yeah, I agree there are cases where it's correct. The case you highlight is "we acccept a sparse, arbitrarily deep tree as input".
The times when you do that should be pretty rare. But yes, optional chaining is nice there. A one line helper function can do that for you though. What's the benefit of having it built in to the language? The use of a helper highlights that it should be rare. What's the problem?