关于什么是的代码案例
let people={
name:"小明"
ename:funtion(){
let that=this;
return function(){
console.log(that.name)
}
}
}
let work=people.ename()
let families=people.prototype
let cou=people.construstr
let fam=families.family={
father:(function(a,b){
console.log(a+b)
})(grandfather,grandmother),
mather:function(){
if(arguments.length>1){
console.log(年龄${arguments[0]}为祖奶)
}else if(arguments.length=1){
console.log(年龄${arguments[0]}为外婆)
}else if(arguments.length<1){
console.log(年龄${arguments[0]}为奶奶)
}
}
brother:promise(function(resovle,reject){
setTimeout(()=>{
if(Math.radndom()>60){
resole("堂哥")
}else{
reject("去世")
}
},2000)
})
}
fam.brother.then(()=>{
console.log("成功")
},()=>{
console.log("失败")
})
cou.countries={
country:"广寒宫",
province:"XXX"
}
let school=Object.create(people,{
sex:{
value:"男"
enumerable:false;
writeable:false;
configurable:false;
},
town:{
get:()={
return cou.countries.country
},
set:(广寒宫)={
if(广寒宫==广寒宫){
console.log("家在广寒宫")
}else{
console.log("家住在地狱")
}
}
enumerable:false;
configurable:false;
}
})
Object.seal(school)
Object.freeze(school)
Object.prevevtExtensions(school)