-
Notifications
You must be signed in to change notification settings - Fork 39
module one assessment initial submit #71
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,8 +12,11 @@ | |
| * returns { 99: 2, 11: 1, 12: 1, 13: 1, 58: 1 } | ||
| */ | ||
|
|
||
| function countNumbers() { | ||
|
|
||
| function countNumbers(arr) { | ||
| arr = {[]} | ||
| for(let i = 0; i < arr.length; i++){ | ||
| return | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this function asking us to return? Do we want to return inside of our for loop? |
||
| } | ||
| } | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ | |
| * | ||
| */ | ||
|
|
||
| function getCountriesSortedByPopulation() { | ||
| function getCountriesSortedByPopulation(arr) { | ||
|
|
||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,8 @@ | |
| * ex: isOdd(75); // true | ||
| */ | ||
|
|
||
| function isOdd() { | ||
|
|
||
| function isOdd(n) { | ||
| return n % 2 === 1 | ||
| } | ||
|
|
||
| module.exports = isOdd | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,8 @@ | |
|
|
||
| */ | ||
|
|
||
| function numberOfDigits() { | ||
| function numberOfDigits(n) { | ||
| return n.toString().length | ||
|
|
||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,8 +19,15 @@ | |
| * returns: [] | ||
| */ | ||
|
|
||
| function removeEvenStrings() { | ||
|
|
||
| function removeEvenStrings(arr) { | ||
| let newArr = [] | ||
| for(let i = 0; i < arr.length; n++){ | ||
| if(i[0] % 2 === 1){ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recall how to index into arrays. What is the variable name for our array and what is the variable name for our index? |
||
| newArr [i-1] = i | ||
| } | ||
| } | ||
| return newArr | ||
| } | ||
|
|
||
|
|
||
| module.exports = removeEvenStrings | ||
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.
Remember to declare your variables with a let or const in front of them. Also, an empty object requires only curly braces, no square brackets necessary.