r/javascript • • Sep 14 '26

AskJS [AskJS] Does anyone use exclussively Javascript and not TypeScript?

[removed]

9 Upvotes

156 comments sorted by

View all comments

Show parent comment

1

u/theScottyJam Sep 15 '26

Yeah, I didn't fully think the example through, but I was thinking more about the difficulty of trying to calculate the new type when this thing is done. Which means, like you said, the example would work better if we were returning a new object instead of mutating an existing one.