-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Solution #4848
base: master
Are you sure you want to change the base?
Solution #4848
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.
Все зрозуміло і чітко.
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.
Good work 👍
Just a few suggestions left
src/calculateRentalCost.js
Outdated
const PRICE_PER_DAY = 40; | ||
const LONG_TERM = 7; | ||
const SHORT_TERM = 3; | ||
const BIG_DISCOUNT = 50; | ||
const SMALL_DISCOUNT = 20; |
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.
Move constants outside the function
src/calculateRentalCost.js
Outdated
const SMALL_DISCOUNT = 20; | ||
|
||
if (days >= LONG_TERM) { | ||
return days * PRICE_PER_DAY - BIG_DISCOUNT; |
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 do days * PRICE_PER_DAY
3 times, create a variable
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.
Good work 👍
function calculateRentalCost(days) { | ||
// write code here | ||
const PRICE = days * PRICE_PER_DAY; |
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.
const PRICE = days * PRICE_PER_DAY; | |
const currentPrice = days * PRICE_PER_DAY; |
Variable names should be in camelCase
No description provided.