ES6 函数扩展

函数在js里是至关重要的一部分了,ES6里也新增了一些函数方法,来看一下javascript { function test(x, y = 'world'){ console.log(x,y); } test('hello');// hello world test('hello','kill');//hello kill } ES6增长了函数参数默认值,能够直接在声明参数
相关文章
相关标签/搜索