Is there a way to deconstruct an array, assign it to a variable, and then pass the value to another deconstructed variable all in one line of code? Take a look at what I want to achieve below:
const { prop } = [a] = chips.filter(x => x.id == 1);
Typically, this would be done in two lines of code like so:
const [a] = chips.filter(x => x.id == 1);
const { prop } = a;
Can this be accomplished on a single line?