多项选择题
关于JS Arguments的说法正确的是()
A.arguments是JS的一个内置对象
B.每一个函数都有一个arguments对象,它包括了函数所要调的参数
C.arguments是数组
D.参数也可以被设置:arguments[1]=’new value’;
相关考题
-
多项选择题
关于箭头函数错误的是()
A.const cat = {lives: 9,jumps: () => { this.lives--; }} ;
B.var button = document.getElementById('press');button.addEventListener('click', () => {this.classList.toggle('on');}); ;
C.let insert = (value) => ({into: (array) => ({after: (afterValue) => { array.splice(array.indexOf(afterValue) + 1, 0, value);return array;}})});
D.const mult2 = a => a * 2; -
多项选择题
function foo(){return()=>{return()=>{return()=>{console.log(’id:’,this.id);};};};}var f=foo.call({id:1});根据上面的代码,下面选项正确的是()
A.var t1 = f.call({id: 2})()(); // id: 2
B.var t2 = f().call({id: 3})(); // id:1
C.var t3 = f()().call({id: 4}); // id: 4
D.var t1 = f.call({id: 2})()(); // id: 1 -
多项选择题
箭头函数有几个使用注意点,正确的是()
A.函数体内的this对象,就是定义时所在的对象,而不是使用时所在的对象
B.不可以当作构造函数,也就是说,不可以使用new命令,否则会抛出一个错误
C.不可以使用arguments对象,该对象在函数体内不存在。如果要用,可以用rest参数代替
D.不可以使用yield命令,因此箭头函数不能用作Generator函数