Skip to content

Thuy Pham - #2

Closed
iamthuypham wants to merge 8 commits into
bloominstituteoftechnology:masterfrom
iamthuypham:master
Closed

Thuy Pham#2
iamthuypham wants to merge 8 commits into
bloominstituteoftechnology:masterfrom
iamthuypham:master

Conversation

@iamthuypham

Copy link
Copy Markdown

No description provided.

// The event director needs both the first and last names of each runner for their running bibs. Combine both the first and last names into a new array called fullName.
let fullName = [];
fullName = runners.forEach((each) => {
return `${each.first_name} ${each.last_name}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I have no doubts you'll manage this without error.

// The donations need to be tallied up and reported for tax purposes. Add up all the donations into a ticketPriceTotal array and log the result
let ticketPriceTotal = [];
console.log(ticketPriceTotal);
ticketPriceTotal[0] = runners.reduce((start, current) =>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Awesome work, poorly worded question.

// Problem 1
// Find all runners whose first and last name have the same first character
runners.filter((each) => (
each.first_name[0] === each.last_name[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.

👍


// Problem 2
// Calculate total donations coming from each company
const getDonationsFromEachCompany = runners.sort((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.

Exceptional use of the docs.


const res = [];

for (let i = 0; i < getDonationsFromEachCompany.length; i++) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For a complexity this high I must ask that you start developing a habit of using comments.

// How many runners come from the same company?
let count = 0
runners.sort((a,b) => { // Sorting whole list by company name
if (a.company_name > b.company_name) return 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this the default functionality of the sort method?

return 0
}).forEach((current, i, arr) => { // Iterate each runner, evaluate the runner's company_name with the next runner's company_name
if (arr[i+1] && current.company_name === arr[i+1].company_name){
count++

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Solid closure.

Comment thread assignments/closure.js
// console.log(newCounter.increment())
// console.log(newCounter.increment())
// console.log(newCounter.increment())
// console.log(newCounter.decrement())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great work. 💯

@ghost ghost left a comment

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 work. You should begin using comments.

@mixelpixel mixelpixel closed this May 21, 2018
brettmadrid added a commit to brettmadrid/JavaScript-II that referenced this pull request Oct 20, 2018
brettmadrid added a commit to brettmadrid/JavaScript-II that referenced this pull request Oct 20, 2018
Git-Grobe added a commit to Git-Grobe/JavaScript-II that referenced this pull request Jan 18, 2019
diamondpowell added a commit to diamondpowell/JavaScript-II that referenced this pull request Jan 19, 2019
BreyBatten added a commit to BreyBatten/JavaScript-II that referenced this pull request Mar 29, 2019
I worked through the first two challenges on the page. I had a breakthrough on bloominstituteoftechnology#2, when I couldn't get it to work and then figured it out.
pvaidya56 added a commit to pvaidya56/JavaScript-II that referenced this pull request Apr 5, 2019
anthonypiazza added a commit to anthonypiazza/JavaScript-II that referenced this pull request May 7, 2019
afberwick pushed a commit to afberwick/JavaScript-II that referenced this pull request May 25, 2019
afberwick pushed a commit to afberwick/JavaScript-II that referenced this pull request May 26, 2019
afberwick pushed a commit to afberwick/JavaScript-II that referenced this pull request May 26, 2019
lizdoyle pushed a commit to lizdoyle/JavaScript-II that referenced this pull request May 28, 2019
hugscity added a commit to hugscity/JavaScript-II that referenced this pull request Sep 17, 2019
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