var x = { name: "japan", age: 20 } x.prototype.mad = function() { alert("USA"); }; x.mad();
上面的代码不起作用。对象字面量不能扩展?或x.mad()呼叫方式不正确。
x.mad()
javascript prototype object-literal
javascript ×1
object-literal ×1
prototype ×1