[英]issue with adding a method in object
我有这个对象:
var Point = {
step: function () {
alert("hello");
}
};
这有效: Point.step();
。
如何使其使用[ ]
表示法? 含义Point["property_name"]
。
这是Point["step"]();
。 这是代码段:
var Point = { step: function () { alert("hello"); } }; Point["step"]();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.