Finished final assessment (Jordan)#57
Open
JordanAlvarado wants to merge 1 commit intojoinpursuit:masterfrom
Open
Finished final assessment (Jordan)#57JordanAlvarado wants to merge 1 commit intojoinpursuit:masterfrom
JordanAlvarado wants to merge 1 commit intojoinpursuit:masterfrom
Conversation
| newArr.sort((a, b) => b.population - a.population) | ||
| for(let i in newArr) { | ||
| finalArr[i] = newArr[i].country | ||
| } |
There was a problem hiding this comment.
Which array method can you use to return a new array with updated information inside? This array method will replace the two loops you have here.
|
|
||
| function numberOfDigits(n) { | ||
| let i = n.toString() | ||
| return i.length |
There was a problem hiding this comment.
How can you condense this code to look cleaner? Consider chaining and implicit returns.
| let vowelsRemoved = '' | ||
| while(i < str.length) { | ||
| if((str[i] !== 'a') && (str[i] !== 'e') && (str[i] !== 'i') && (str[i] !== 'o') && (str[i] !== 'u')) { | ||
| if((str[i] !== 'A') && (str[i] !== 'E') && (str[i] !== 'I') && (str[i] !== 'O') && (str[i] !== 'U')) { |
There was a problem hiding this comment.
Explore using the .includes() method to make this function more readable.
| let arr = [] | ||
| let i = 1 | ||
| while(i <= n){ | ||
| if(((i % 7) === 0) || (i % 10) === 7){ |
There was a problem hiding this comment.
Consider what would happen to the numbers 70-79. Would you receive the word "BOOM" with every number that contains 7?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.