0

If you access the arguments object within an Arrow function, for example:

(() => {
    console.dir(arguments);
})();  

Then you get a large, nested object back:

{ '0': {},
  '1':
   { [Function: require]
     resolve: { [Function: resolve] paths: [Function: paths] },
     main:
      Module {
        id: '.',
        exports: {},
        parent: null,
        filename: 
...

What is this object? What is its meaning?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
cluster1
  • 4,968
  • 6
  • 32
  • 49
  • [*"Arrow functions do not have their own arguments object."*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) – jonrsharpe Dec 06 '17 at 07:53
  • `Uncaught ReferenceError: arguments is not defined`. That's probably the `arguments` of the parent scope. – Cerbrus Dec 06 '17 at 07:54
  • @Cerbrus Yep. I think it's the arguments object of the global scope. – cluster1 Dec 06 '17 at 08:28
  • @mizech: The global scope doesn't have an `arguments` object. – Cerbrus Dec 06 '17 at 08:29
  • @mizech This looks like the `arguments` object of your node module https://stackoverflow.com/a/15411236/1048572 – Bergi Dec 06 '17 at 10:22

0 Answers0