In looking at an article on javascript classes, the author uses this syntax:
class GuitarAmp {
constructor ({ cabinet = 'spruce', distortion = '1', volume = '0' } = {}) {
Object.assign(this, {
cabinet, distortion, volume
});
}
}
What is the purpose of the = {} bit in the constructor parameter listing? Aren't we setting default parameters for cabinet, distortion and volume?