Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

cmhorsey
Copy link

@cmhorsey cmhorsey commented May 6, 2024

No description provided.

Copy link

@stephenmckeon stephenmckeon left a 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 ) {

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.

Suggested change
} else if (number > 400 && number < 2000 ) {
} else if (number < 2000 ) {

// Write your code here!
function scuberGreetingForFeet(number){
let result
if( number < 400 ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same idea here.

Suggested change
} else if (number > 2500) {
} else {

Comment on lines +16 to +17
const message = city === 'NYC' ? "Ok, sounds good." : "No go.";
return message;

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:

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants