Thank you for your guidance.
I'd like to find a simple way of passing function arguments, to populate a de-structured variable. Hit a stumbling block, is this possible? As I'd like to then use a Rest... operator and tidy up my code - it is an incredible syntax if possible.
This Works:
let cat = {
Models: {
brand: ['sku1', 'sku2', 'sku3', 'sku4', 'sku5']
}
};
let {brand} = cat.Models;
for (let [key,value] of Object.entries(brand)) {
console.log(`${key} ${value}`)
};
This does not:
function wrapper(b) {
let {b} = skus.Models;
for (let [key,value] of Object.entries(b)) {
console.log(`${key} ${value}`)
};
}
wrapper('brand');