递归求和:
function a (num,start,end) {
num = num + start
start++
if(start>100){
console.log(num)
return num
}
a(num,start,end)
}
a(0,1,100)
求两个数组内相同的数:
let a = ['a','b','c','c','c','d']
let b = ['c','d','v','d','d','f','c']
function c () {
return a.filter((i,index,array)=>{
let d = b.includes(i) // let d = b.indexOf(i) > -1
return d
})
}
let h = c()
console.log(h)