s定义在外面和里面完全不一样?
const _flatten = arr => {
var s=[]
if(arr.length==2){
s.push(arr[0])
_flatten(arr[1])
}else{
s.push(arr[0])
}
return s
}
------------------------------------------------------------------------------
var s=[]
const add = arr => {
if(arr.length==2){
s.push(arr[0])
add(arr[1])
}else{
s.push(arr[0])
}
return s
}