Skip to content

learning foreach - #177

Open
bwhite06 wants to merge 5 commits into
bloominstituteoftechnology:masterfrom
bwhite06:master
Open

learning foreach#177
bwhite06 wants to merge 5 commits into
bloominstituteoftechnology:masterfrom
bwhite06:master

Conversation

@bwhite06

Copy link
Copy Markdown

No description provided.

@TERR1E TERR1E 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.

fullName.push(i.first_name);
fullName.push(i.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.

You did not have to put .forEach inside a function - just needed to use .forEach with a function to push first_name and last_name to fullName array

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 your push you can also use this syntax to combine the two. variable.push(param.property + " " + param.property);

fullName.push(i.last_name);

});
JSON.stringify(fullName);

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 can just use a console.log which you used in line 60.


let ticketPriceTotal = 0;
let result=[];
for (var i = 0; i < runners.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.

Try not to use var

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.

3 participants