Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible error in Lesson 10: Javascript VII (Closure) class notes #1591

Open
aellis77 opened this issue Jun 4, 2018 · 0 comments
Open

Possible error in Lesson 10: Javascript VII (Closure) class notes #1591

aellis77 opened this issue Jun 4, 2018 · 0 comments

Comments

@aellis77
Copy link

aellis77 commented Jun 4, 2018

In the lesson 10: Javascript VII (Closure) class notes for the mini web boot camp we have the following: Here is the context :
This also applies to the function's parameters:

function makeMultiplier(x) {
    return function(y) {
        return x * y;
    }
}

const multiplyByFive = makeMultiplier(5);
const product1 = multiplyByFive(10);

const multiplyByTwo = makeMultiplier(5);
const product2 = multiplyByTwo(7);

console.log(product1); // logs 50
console.log(product2); // logs 14

For product 2, the const multiplyByTwo = makeMultiplier(5); This implies that we will be multiplying by 5. This doesn't match the context of the constant name, nor does it create a result of product2 = 14 = 2*7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant