问题描述
假设我们有一个名为Foo()
的类,该类将值作为参数并具有某种方法method1,metohd2,...
。
let y = new Foo(56);
console.log(y) // output should be 56 not the class object
y.addOne() // output: adds one to the value
console.log(y) // output should be 57
我们可以这样做吗?不仅是Numbers
,还不是其他数据类型?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)