-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Create Three Functions #18
base: master
Are you sure you want to change the base?
Create Three Functions #18
Conversation
if (depth <=400) { | ||
return 'This one is on me!' | ||
} else if (depth <= 2000) { | ||
return 'That will be twenty bucks.' | ||
} else if (depth <= 2500) { | ||
return `I will gladly take your thirty bucks.` | ||
} else { | ||
return `No can do.` | ||
} | ||
} |
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 (depth <=400) { | |
return 'This one is on me!' | |
} else if (depth <= 2000) { | |
return 'That will be twenty bucks.' | |
} else if (depth <= 2500) { | |
return `I will gladly take your thirty bucks.` | |
} else { | |
return `No can do.` | |
} | |
} | |
if (depth <=400) { | |
return 'This one is on me!' | |
} else if (depth <= 2000) { | |
return 'That will be twenty bucks.' | |
} else if (depth <= 2500) { | |
return `I will gladly take your thirty bucks.` | |
} else { | |
return `No can do.` | |
} | |
} |
function ternaryCheckCity(){ | ||
// Write your code here! | ||
function ternaryCheckCity(city){ | ||
return city === `NYC`?`Ok, sounds good.` : `No go.` |
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.
return city === `NYC`?`Ok, sounds good.` : `No go.` | |
return city === `NYC` ? `Ok, sounds good.` : `No go.` |
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.
Just a few notes about spacing, but otherwise looks great.
return `Thank you.` | ||
default: | ||
return `Bye.` | ||
|
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.
Create function using if else if. Create ternary function. Create function with switch