87,993
社区成员
发帖
与我相关
我的任务
分享
var a={
b:function(){
alert("b");
}
}
function Person() { };
//实现部分
Person.prototype = {
set: function (value) {
this.value = value;
return this;
},
get: function () {
return this.value * 2;//由于要返回值,且不需要继续调用方法,所以不返回this
}
}
var person = new Person();
console.log(person.set(10).get());//20
let a = {
b: () => {
return {
c: () => {console.log("enter c");}
}
}
}
var a={
b:function(){
x={
c:function(){
console.log("nihoa");
}
}
return x;
}
}