const isEmpty = function(obj){
for(let newObj in obj){
return false
}
return true
}
let sum = 0
const sumMoney = function(obj){
for(let m in obj){
sum += obj[m]
}
return 0
}
let obj = {
}
console.log(isEmpty(obj))
let moneyObj = {
zhangsan: 12000,
lisi: 50000,
wangwu: 90000
}
sumMoney(moneyObj)
console.log(sum)
const multiplyNumeric = function(obj){
for(let i in obj){
if(typeof obj[i] == 'number'){
obj[i] *= 2
}
}
}
let obj2 = {
num1: 22,
num2: 44,
st3: '所事事'
}
multiplyNumeric(obj2)
console.log(obj2)
let calculator = {
read(n1,n2){
this.num1 = ''?0:n1
this.num2 = ''?0:n2
console.log(calculator)
},
sum(){
console.log(this.num1+this.num2)
},
mul(){
console.log(this.num1*this.num2)
}
}
calculator.read('1','')
calculator.sum()
calculator.mul()
let a = [1,2,3,4,5,6,7]
let b = []
console.log(a==b)
a.splice(2,2,20,50)
a.splice(-1,0,100,200,300)
console.log(a)
console