getify / You-Dont-Know-JS

A book series on JavaScript. @YDKJS on twitter.
Other
178.28k stars 33.42k forks source link

Don't used parameter #1662

Closed YaroslavTER closed 4 years ago

YaroslavTER commented 4 years ago

Does this a parameter have a sense in this case? Because it looks redundant.

Yes, I promise I've read the Contributions Guidelines (please feel free to remove this line).


Please type "I already searched for this issue": I already searched for this issue

Edition: 1st

Book Title: this & object prototypes

Chapter: 2nd

Section Title: Lexical this

Problem: unused parametr a

function foo() {
    // return an arrow function
    return (a) => {
        // `this` here is lexically adopted from `foo()`
        console.log( this.a );
    };
getify commented 4 years ago

Asked several times before, please search existing issues.