Object.prototype.toString.call(args)进行类型判断
Object.prototype.toString.call('123') [object String]
Object.prototype.toString.call([123]) [object Array]
Object.prototype.toString.call({a:123}) [object Obeject]
Object.prototype.toString.call(/123/) [object RegExp]
Object.prototype.toString.call(123) [object Number]
Object.prototype.toString.call(undefined) [object undefined]
Object.prototype.toString.call(null) [object Null]
Array.prototype.slice.apply(arguments)
当遇到需要将参数转换为数组时可以改方法。这种方法是有效的,而且在主流浏览器上都测试通过。