r/node • • Nov 10 '20

Conditionally call a function with optional chaining.

Post image
345 Upvotes

126 comments sorted by

View all comments

58

u/dudeitsmason Nov 10 '20

Just because you can, doesn't mean you should

0

u/[deleted] Nov 10 '20

[deleted]

14

u/dudeitsmason Nov 10 '20

I agree, optional chaining rocks, but there's something unsettling about using it between a function variable and it's invocation I guess?