Skip to content

Toua's javascript II project#392

Open
txiong000 wants to merge 2 commits into
bloominstituteoftechnology:masterfrom
txiong000:master
Open

Toua's javascript II project#392
txiong000 wants to merge 2 commits into
bloominstituteoftechnology:masterfrom
txiong000:master

Conversation

@txiong000

Copy link
Copy Markdown

No description provided.

let ticketPriceTotal = [];
let ticketPriceTotal = runners.reduce(function(accumalator, currentValue){
return accumalator + currentValue.donation;
}, 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

all of these are correct, good job!


// Problem 2
// Problem 2 Anyone who donated $200 or more will get a logo on the finish line flag.
let logoOnBanner = runners.filter(items => items.donation >= 200);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice examples!

Comment thread assignments/callbacks.js

function sumNums(x, y, cb) {
// sumNums adds two numbers (x, y) and passes the result to the callback.
return cb(x, y);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

you would want to put the operator into this function rather than the console log below

Comment thread assignments/callbacks.js

function multiplyNums(x, y, cb) {
// multiplyNums multiplies two numbers and passes the result to the callback.
return cb(x, y);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

you want to put the multiply operator in this function

Comment thread assignments/callbacks.js
} else {
return cb(false);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

good job here

Comment thread assignments/closure.js
return function() {
n+=1;
return n;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

well done

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