Yogesh Chavan
1 min readDec 11, 2019

--

Thanks Siregar . We only use destructuring for array and objects. so you know certain thing is a object / array to destructure. So you don’t need a fallback. If you have empty object, destructuring will still work and the values will be undefined.

For ex.

const { name, age } = {};
console.log(name, age); // undefined undefined

--

--

Yogesh Chavan
Yogesh Chavan

No responses yet