--

If you destructure a property that’s not defined, either because it has the value of undefined or isn’t a property on the object, then you assign new variables with the value of undefined.

const {a,b} = {a:undefined};console.log(a,b)
// undefined undefined

--

--

Dr. Derek Austin 🥳
Dr. Derek Austin 🥳

Written by Dr. Derek Austin 🥳

Hi, I'm Doctor Derek! I've been a professional web developer since 2005, and I love writing about programming with JavaScript, TypeScript, React, Next.js & Git.

No responses yet