Skip to content

v1#397

Open
codypeak wants to merge 1 commit intobloominstituteoftechnology:masterfrom
codypeak:master
Open

v1#397
codypeak wants to merge 1 commit intobloominstituteoftechnology:masterfrom
codypeak:master

Conversation

@codypeak
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@Velsu Velsu left a comment

Choose a reason for hiding this comment

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

Good job on the assignment Ian. You have completed most of the exercises, altough some of them have issues that i explained in the github comments below.

Your git workflow needs improvement. Try to make more descriptive and frequent commit messages.

// ==== Challenge 1: Use .forEach() ====
// 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 = [];
let fullName = runners.map(function(item) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

forEach was supposed to be used here instead of map.

let allCaps = [];
console.log(allCaps);
let allCaps = runners.map(function(item) {
return item[i].first_name.toUpperCase();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No need for i which is undefined anyway.


// ==== Challenge 2: Create a counter function ====
const counter = () => {
let counterVar = 0 += x;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is invalid left hand side assignment.

function getLength(arr, cb) {
// getLength passes the length of the array into the callback.
return cb(arr.length);
getLength(item, function(arrayLength) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No need for that line of code.


function last(arr, cb) {
// last passes the last item of the array into the callback.
return cb(arr.length-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.

Should be cb(arr[arr.length -1])

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