-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Complete Lab #16
base: master
Are you sure you want to change the base?
Complete Lab #16
Conversation
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.
Great work! Just a few thoughts to consider, but no need to make any changes unless you want to.
let result | ||
if( number < 400 ) { | ||
result = 'This one is on me!'; | ||
} else if (number > 400 && number < 2000 ) { |
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.
You don't need to include the > 400
bit since the first part of the conditional covers that.
} else if (number > 400 && number < 2000 ) { | |
} else if (number < 2000 ) { |
// Write your code here! | ||
function scuberGreetingForFeet(number){ | ||
let result | ||
if( number < 400 ) { |
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.
if( number < 400 ) { | |
if (number < 400) { |
result = 'That will be twenty bucks.'; | ||
} else if (number >= 2001 && number < 2500 ) { | ||
result = 'I will gladly take your thirty bucks.'; | ||
} else if (number > 2500) { |
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.
Same idea here.
} else if (number > 2500) { | |
} else { |
const message = city === 'NYC' ? "Ok, sounds good." : "No go."; | ||
return message; |
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.
While this works, you can simply return the ternary:
const message = city === 'NYC' ? "Ok, sounds good." : "No go."; | |
return message; | |
return city === 'NYC' ? 'Ok, sounds good.' : 'No go.; |
Also, try to be consistent with using either single and double quotes, but not both.
No description provided.