Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carina Taveras #170

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Carina Taveras #170

wants to merge 11 commits into from

Conversation

tCarina
Copy link

@tCarina tCarina commented Jan 4, 2021

No description provided.

@@ -66,7 +117,9 @@ function findSmallest() {}
* @returns {number} second smallest value
*/

function findSecondSmallest() {}
function findSecondSmallest(nums) {

Choose a reason for hiding this comment

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

Think about how you can use your findSmallest function to find this answer

@@ -83,7 +136,11 @@ function findSecondLargest() {}
* @returns {array} nums without the duplicates
*/
// Hint: Look into the `.includes` method.
function removeDups() {}
function removeDups(nums) {
let duplicates = []

Choose a reason for hiding this comment

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

Look up the .includes() method to solve this

function endsWithFiveWhileLoop() {}
function endsWithFiveWhileLoop() {
let newArray= []
let i = 1

Choose a reason for hiding this comment

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

Another way to write this is to start i at 5 since no number before that will end with 5

Then you can increment i by 5 in a for loop

Just another way to think about it!

let newArray = []
for (let i of array){
newArray.push(i + "!")
i++;

Choose a reason for hiding this comment

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

"for of" loops increment themselves so you don't need i++

also remember i isn't an index in a for of loop, it's the element, so this is like saying "happy"++

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