Skip to content

Andres Ballares - #172

Open
AndresBallares wants to merge 3 commits into
joinpursuit:masterfrom
AndresBallares:master
Open

Andres Ballares#172
AndresBallares wants to merge 3 commits into
joinpursuit:masterfrom
AndresBallares:master

Conversation

@AndresBallares

Copy link
Copy Markdown

No description provided.

newArray.push(array[i] + "!");
}
return newArray;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good!

Comment thread problems/arraysWithLoops.js Outdated

function findSmallest() {}
function findSmallest(nums) {
let i = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We don't need this i here b/c we're declaring an i with our for loop.

function findSecondLargest(nums) {

let largest = Infinity;
let secondLargest = Infinity;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we start at Infinity and are looking for the largest number, Infinity will always win. What's the smallest number in the world that we can start with?

Comment thread problems/loops.js
i++;
} else {
arr.push(i + " is odd");
i++;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we can move i++ outside / after the if else b/c it should increment regardless.

Comment thread problems/loops.js
newArray.push(sum);
}
return newArray;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice job on these!

@AndresBallares

AndresBallares commented Jan 25, 2021 via email

Copy link
Copy Markdown
Author

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