2017-08-11 62 views
-2

我是新手。请告诉下面的JavaScript有哪些不能显示的功能,非常感谢。JavaScript无法显示

var car = { 
    size: "small", 
    color: "red", 
    show: function() { 
    console.log("This is my " + car.size); 
    } 
}; 

show(); 
+0

使用'car.show()' – vatavale

回答

0

你必须使用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

0
var car = { 
    size: "small", 
    color: "red", 
    show: function() { 
    console.log("This is my " + car.size); 
    } 
    }; 

car.show();// You should call like this