Given the following code:
const civic = {make: 'Honda', model: 'Civic'};
function logArgs(make, model) {
console.log(make);
console.log(model)
}
I want to do this:
logArgs(...civic);
instead of:
logArgs(civic.make, civic.model);
I get:
(index):39 Uncaught TypeError: Found non-callable @@iterator
Is there some way to destructure objects like arrays, or is what I am trying to do impossible?