Conversation
|
|
||
| // TODO: write code in this function body to pass the tests | ||
| if (num >= lower && num <= upper) { | ||
| return true |
There was a problem hiding this comment.
This can be simplified num >= lower && num <= upper as it will resolve to either a true or false value. Try:
return num >= lower && num <= upper| function isHelloOrGoodbye (val1) { | ||
|
|
||
| // TODO: write code in this function body to pass the tests | ||
| if (val1 === 'Hello' || val1 === 'Goodbye') { |
There was a problem hiding this comment.
same as above and seen in other files too, have a look through:
return val1 === 'Hello' || val1 === 'Goodbye'| count++ | ||
| } | ||
| } | ||
| if (count%2 !== 0) { |
There was a problem hiding this comment.
same as a lot of the if statements throughout, you can just return the boolean:
return count%2 !== 0|
|
||
| // TODO: write code in this function body to pass the tests | ||
|
|
||
| if (array.length === 0) { |
There was a problem hiding this comment.
same as others, just return the boolean
|
|
||
| // TODO: write code in this function body to pass the tests | ||
|
|
||
| if (num1 > num2) { |
There was a problem hiding this comment.
same as others, just return the boolean
|
|
||
| // TODO: write code in this function body to pass the tests | ||
|
|
||
| if (val1 === 'Hello') { |
There was a problem hiding this comment.
same as others, just return the boolean
|
|
||
| // TODO: write code in this function body to pass the tests | ||
| if (val1 !== 'Hello') { | ||
| return true |
There was a problem hiding this comment.
same as others, just return the boolean
| // TODO: write code in this function body to pass the tests | ||
|
|
||
| if (val1.length > val2.length) { | ||
| return true |
There was a problem hiding this comment.
same as others, just return the boolean
No description provided.