wesbos / es6-articles

Blog Posts from Wes Bos. If you make an edit to one of these posts, my blog will automatically update.
553 stars 169 forks source link

Update 18-3 - Destructuring Objects.md #34

Closed a15n closed 6 years ago

a15n commented 7 years ago

Fixes a typo. ES6 destructuring default values only kick in when the value is undefined.

This can be viewed as a follow-up to this commit https://github.com/wesbos/es6-articles/commit/b3c018f2806fb2f921aef7ee99eefa458d5d4484

wesbos commented 7 years ago

Oh wait I think this is correct.

Default values will kick in if the value is not present, or explicitly undefined.

0, null, and false are still considered values

a15n commented 7 years ago

Exactly. That's how I understand it. I think that's how it's portrayed in the new copy I recommend in this PR.