Can I use an argument called "arguments" in JavaScript?

I am writing a library that provides the following function

function call(instance, func, arguments) {
  return {
    call: {
      instance: instance,
      func: func,
      arguments: arguments
    }
  }
}

Is the name argumentsok used? This is really the best name for it, but I don't want to deal with a built-in variable. He works at Node. Will this work in all browsers and JavaScript environments?

Edit:

Please note that the above function works as expected in Node. I am wondering if this will work everywhere.

I would prefer not to rename it if there is no technical reason. I would really like this external function and documents to display this parameter name, because the returned object will be serialized as JSON and used in different languages.

+4
2

arguments "sloppy", .

, , .

function a(arguments) {
    console.log(arguments);
}
a(1);
// Prints "1"

(function () {
    'use strict';
    function a(arguments) {
        console.log(arguments);
    }
    a(1);
}());
// Uncaught SyntaxError: Unexpected eval or arguments in strict mode

"". , - , Object , Object.keys. , , arguments, varargs JS.

, . , : , arguments, .

+6

, . arguments - , . , .

, parameters ?

EDIT: , , :

function sayHelloTo(objectToSayHiTo){
  alert("Hello "+arguments[0]+"!");
}

sayHelloTo("world");
Hide result

№ 2:

-, :

function sendGreetings(name, arguments){
    alert("I'm "+name+"!");
    for(var count=0;count<arguments.length;count++){
      alert("Hello "+arguments[count]+"!");
    }
}

sendGreetings("kittycat3141", ["world", "StackExchange", "Joe"]);
Hide result

.

№ 3 5 (IE, Chrome, Safari, Firefox Opera), . , iCobot , , , , .

+4

All Articles