Kết quả của đoạn code javascript sau là gì? Và hãy giải thích tại sao?
Kết quả của đoạn code javascript sau là gì? Và hãy giải thích tại sao?
class Chameleon {
static colorChange(newColor) {
this.newColor = newColor;
return this.newColor;
}
constructor({ newColor = "green" } = {}) {
this.newColor = newColor;
}
}
const freddie = new Chameleon({ newColor: "purple" });
freddie.colorChange("orange");
orangepurplemiddle
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào