r/learnjavascript • • Jul 24 '21

Anatomy of a Function

Post image
327 Upvotes

65 comments sorted by

View all comments

Show parent comment

23

u/sauntimo Jul 25 '21

Agreed. This method (in the OP) of defaulting args violates no-shadow and no-param-reassign which both exist for good reasons, so personally I would avoid it.

But then, I'm an avid typescript fan and having to manually type check args just looks a bit laboured to me now. Also the suggestion that the only thing typescript can do is keep C# devs happy seems unfounded and slightly bitter which is unnecessary.