让thisArray = ['sage','迷迭香','欧芹','百里香'];使用扩展语法,我们刚刚实现了一个操作,如果我们使用传统方法,这个操作会更复杂,更冗长。
让那个阵容= ['罗勒','香菜',......这个阿雷,'香菜'];
//现在等于['罗勒','香菜','鼠尾草','迷迭香','欧芹','百里香','香菜']
spreadOut
,它返回变量sentence
,使用spread运算符修改函数,使它返回数组['learning', 'to', 'code', 'is', 'fun']
。 spreadOut
应该返回["learning", "to", "code", "is", "fun"]
'
testString: 'assert.deepEqual(spreadOut(), ["learning", "to", "code", "is", "fun"], "spreadOut
should return ["learning", "to", "code", "is", "fun"]
");'
- text: spreadOut
函数应该使用扩展语法
testString: 'assert.notStrictEqual(spreadOut.toString().search(/[...]/), -1, "The spreadOut
function should utilize spread syntax");'
```