r/learnjavascript • • Mar 23 '21

Assigning default value

Post image
278 Upvotes

24 comments sorted by

View all comments

Show parent comments

25

u/fukitol- Mar 23 '21

Been using js for years and didn't know about ??. Thanks for that.

18

u/madspillage Mar 23 '21

It was only added in javascript a couple of years ago.

17

u/senocular Mar 23 '21

It's part of ES2020 published in June 2020, so really not even one year yet.

6

u/madspillage Mar 23 '21

Oh yeah. My bad. In my head it seemed older.