标签:
var parts = [‘shoulders‘, ‘knees‘]; var lyrics = [‘head‘, ...parts, ‘and‘, ‘toes‘]; // ["head", "shoulders", "knees", "and", "toes"] var arr1 = [0, 1, 2]; var arr2 = [3, 4, 5]; arr1.push(...arr2); // [0,1,2,3,4,5 function myFunction(v, w, x, y, z) { console.log(v, w, x, y, z); } var args = [0, 1]; myFunction(-1, ...args, 2, ...[3]);] //-1, 0 , 1, 2, 3
标签:
原文地址:http://www.cnblogs.com/Answer1215/p/4999521.html