JavaScript Question 8
Question 8 of 0JavaScript
What's the output?
Code:
class Chameleon {
static colorChange(newColor) {
this.newColor = newColor;
return this.newColor;
}
constructor({ newColor = 'green' } = {}) {
this.newColor = newColor;
}
}
const freddie = new Chameleon({ newColor: 'purple' });
console.log(freddie.colorChange('orange'));Select the correct option:
Question discussion
(0)Join the discussion — login to comment and help other developers.
Login to comment