Array.splice 是不纯的函数,有副作用
arr.splice(0,2) < [1,2]
arr.splice(0,2) < [3]
arr.splice(0,2) < []
//es6
var checkage = age => age > 18;
Array.splice 是不纯的函数,有副作用
arr.splice(0,2) < [1,2]
arr.splice(0,2) < [3]
arr.splice(0,2) < []
//es6
var checkage = age => age > 18;