Skip to content

Amine dassouki - #1

Open
Zubeii wants to merge 6 commits into
masterfrom
amine-dassouki
Open

Amine dassouki#1
Zubeii wants to merge 6 commits into
masterfrom
amine-dassouki

Conversation

@Zubeii

@Zubeii Zubeii commented Jul 1, 2019

Copy link
Copy Markdown
Owner

No description provided.

@Zubeii
Zubeii requested a review from dswhitely1 July 1, 2019 01:42
Comment thread assignments/callbacks.js Outdated
// sumNums adds two numbers (x, y) and passes the result to the callback.
// sumNums adds two numbers (x, y) and passes the result to the callback.
return cb(x, y);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you are working with Callbacks, you want to pass the function to the higher order function. For example:

function sumNums(x,y,cb) {
     return cb(x + y);
}

sumNums(1, 2, sum => {
    console.log(sum) // Result : 3
});

Look at this example to answer the multiply one.

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

Successfully merging this pull request may close these issues.

2 participants