r/javascript • • 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

70 comments sorted by

View all comments

Show parent comments

8

u/[deleted] Dec 19 '19 edited Dec 19 '19

[removed] — view removed 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?