-
Notifications
You must be signed in to change notification settings - Fork 168
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
base: master
Are you sure you want to change the base?
Carina Taveras #170
Conversation
@@ -66,7 +117,9 @@ function findSmallest() {} | |||
* @returns {number} second smallest value | |||
*/ | |||
|
|||
function findSecondSmallest() {} | |||
function findSecondSmallest(nums) { |
There was a problem hiding this comment.
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
problems/arraysWithLoops.js
Outdated
@@ -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 = [] |
There was a problem hiding this comment.
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
problems/loops.js
Outdated
function endsWithFiveWhileLoop() {} | ||
function endsWithFiveWhileLoop() { | ||
let newArray= [] | ||
let i = 1 |
There was a problem hiding this comment.
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++; |
There was a problem hiding this comment.
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"++
No description provided.