span{
display: inline-block;
width:100px;
}
foo
bar
let car = {
year:2014,
_price:111,
}
Object.defineProperty(car, 'price', {
enumerable: true,
configurable: true,
get(){
console.log('price属性被读取了')
return this._price
},
set(newVal){
console.log('price属性被修改了')
this._price = newVal
}
})
// [1,2,3].map((parseInt));
let people={
age:1,
f:function(){console.log(1)},
name:'222'
}
// var key;
for( var key in people){
console.log(people[key])
}
一键复制
编辑
Web IDE
原始数据
按行查看
历史