我是新手。請告訴下面的JavaScript有哪些不能顯示的功能,非常感謝。JavaScript無法顯示
var car = {
size: "small",
color: "red",
show: function() {
console.log("This is my " + car.size);
}
};
show();
我是新手。請告訴下面的JavaScript有哪些不能顯示的功能,非常感謝。JavaScript無法顯示
var car = {
size: "small",
color: "red",
show: function() {
console.log("This is my " + car.size);
}
};
show();
你必須使用car.show() 嘗試,然後回覆我cmnts什麼是你的輸出
var car = { size: "small", color: "red", show: function() { console.log("This is my " + car.size); } }; car.show(); // reffer to object first and then to your func
var car = {
size: "small",
color: "red",
show: function() {
console.log("This is my " + car.size);
}
};
car.show();// You should call like this
使用'car.show()' – vatavale