严格模式不会出现使用隐式参数吗?

时间:2017-04-29 07:10:13

标签: javascript

这是对的吗?这是新的吗?

我的意思是每个函数都有btw的隐式参数。

我注意到当我在严格模式下使用参数时,我的代码失败了,如果我删除严格模式没有问题...这是新的还是一直都是这样?

console.log('foo.js running');
(function() {
  // 'use strict';
  // unexpected arguments in strict mode ...

这是我使用它的地方:

  _.extend = function(obj) {
    _.each(Array.prototype.slice.call(arguments, 1), function (object) {
      _.each(object, function(val, key){
        obj[key] = val;
      })
    });
    return obj;
  }

1 个答案:

答案 0 :(得分:1)

不,严格模式不会阻止使用Location: http://myserver:8080/bitacora/index.php/devices。它会稍微改变:arguments对象不再与命名参数绑定,因此:



arguments