题目,1 + 2 + 3+4+5,累加
created
this.call()
methods
call() {
console.log(this.Visibl(2))
},
Visibl(n) {
if (n === 1) {
return 1
}
const a = this.Visibl(n - 1) + n
}
第二方法
for (let index = 1; index < sum + 1; index++) {
const element = index
this.sumo = element
if (this.sumo === element) {
this.sumo += element + 1
console.log(this.sumo)
}
}