Dynamic Key Names with ES6 destructutinh
https://stackoverflow.com/questions/35939289/how-to-destructure-into-dynamically-named-variables-in-es6
by lasha
JavaScript
const fruits = ["π", "π", "π"];
const labels = ["apple", "banana", "pear"];
const newLabels = {};
for (let i = 0; i < fruits.length; i++) {
({
[fruits[i]]: newLabels[labels[i]] = fruits[i]
} = fruits);
console.log(newLabels);
}