是否有任何方法可以在调用对象时返回该对象的字段?
function Int16(v) { this.v=v }; var n = new Int16(10);
// Instead of "n.v", I would want to use "n" directly
if (n.v == 10) { console.log("ok") }
是否有任何方法可以在调用对象时返回该对象的字段?
function Int16(v) { this.v=v }; var n = new Int16(10);
// Instead of "n.v", I would want to use "n" directly
if (n.v == 10) { console.log("ok") }