CODING CHALLENGES// Arrow Functions Don't Have Their Own Arguments

I am half way through the ES6 portion of the course. When should I start doing code challenges from different websites?

What do you guys know about arrow functions not having their own arguments? “Arrow functions do not have an own arguments binding in their scope; no arguments object is created when calling them.”

you can still use an arrow function with arguments, and I think you will find all the information your looking for by researching these links:
can you bind arrow functions

arrow functions

2 Likes

You can also use the rest operator (...) to mimic arguments in an arrow function:

const fn1 = (...args) => args;

function fn2() {
  return arguments;
}

fn1(1, 2, 3).length === fn2(1, 2, 3).length; // true

Note that they’re still not exactly the same, as arguments is a special array-like object, not an actual array. Still, for most use cases, they’re basically equivalent.

2 Likes

thank you for the help!

thank you kravmaguy the information in the link was very helpful.

1 Like