首页 > 解决方案 > 未捕获的 SyntaxError:标识符“源”已被声明

问题描述

const source = [1,2,3,4,5,6,7,8,9,10];

function removeFirstTwo(list) {
    const [,, ...arr] = list; // Change this line
    return arr;
}

const arr = removeFirstTwo(source);
/* In chrome developer tools this line is giving the error
I mentioned. but it's working on freecodecamp website. */

标签: javascript

解决方案


推荐阅读