Open
Conversation
phillipdunn
reviewed
Dec 20, 2021
| // TODO: write code in this function body to pass the tests | ||
| // TODO: write code in this function body to pass the tests | ||
|
|
||
| if (num >= lower && num <= upper) { |
There was a problem hiding this comment.
an if statement is not needed here you can just return the boolean, like this:
return num >= lower && num <= upper
phillipdunn
reviewed
Dec 20, 2021
| function isHelloOrGoodbye(val1) { | ||
|
|
||
| // TODO: write code in this function body to pass the tests | ||
| if (val1 === 'Hello' || val1 === 'Goodbye') { |
phillipdunn
reviewed
Dec 20, 2021
| function isArrayEmpty(array) { | ||
|
|
||
| // TODO: write code in this function body to pass the tests | ||
| if (array.length === 0) { |
phillipdunn
reviewed
Dec 20, 2021
|
|
||
| // TODO: write code in this function body to pass the tests | ||
| // TODO: write code in this function body to pass the tests | ||
| if (num1 > num2) { |
phillipdunn
reviewed
Dec 20, 2021
| function isHello(val1) { | ||
|
|
||
| // TODO: write code in this function body to pass the tests | ||
| if (val1 === 'Hello') { |
phillipdunn
reviewed
Dec 20, 2021
| // TODO: write code in this function body to pass the tests | ||
| // TODO: write code in this function body to pass the tests | ||
| if (val1 !== 'Hello') { | ||
| return true |
phillipdunn
reviewed
Dec 20, 2021
| function isLongerThan(val1, val2) { | ||
|
|
||
| // TODO: write code in this function body to pass the tests | ||
| if (val1.length > val2.length) { return true } else { |
phillipdunn
reviewed
Dec 20, 2021
| counts++ | ||
| } | ||
| } | ||
| if (counts % 2 !== 0) { |
There was a problem hiding this comment.
same here just return the boolean (the condition)
phillipdunn
reviewed
Dec 20, 2021
|
|
||
| // Set fourthCity to the 4th element in the cities array | ||
| const fourthCity = '' | ||
| const fourthCity = 'Delhi' |
There was a problem hiding this comment.
You have hard coded this, but should be accessing the 3rd element in the array:
cities[3]
phillipdunn
reviewed
Dec 20, 2021
|
|
||
| // Set firstCity to the 1st element in the cities array | ||
| const firstCity = '' | ||
| const firstCity = 'London' |
phillipdunn
reviewed
Dec 20, 2021
| // use an array method to remove the last item from the fruits array and store the value in the pear variable | ||
| const pear = fruits.undefined | ||
| const pear = 'Pear' | ||
| fruits.pop('Pear') |
There was a problem hiding this comment.
the assignment on line 31 is unnecessary, also line 32 you don't need to pass an argument/param to .pop(). You just need :
fruits.pop()
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.