原来不用 arguments 是能可变参的(我还是菜),那就是
function xxx(...args) { console.log.apply(console, args) }
就可以了吧,总算会封装这玩意了,加个名字跟 getLogger (
@literalkernel 这是es6的解构操作符
@mashiro https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Functions/rest_parameters
@literalkernel arguments是一个数组,这个相当于解构了
@literalkernel 像这样
@mashiro 原来是这样啊
每个人都有属于自己的一片森林,也许我们从来不曾走过,但它一直在那里,总会在那里。迷失的人迷失了,相逢的人会再相逢。愿这里,成为属于你的小森林。
@mashiro https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Functions/rest_parameters