Glasgow_6 - Ehdaa_Sakawi - javaScript - Week_2#453
Glasgow_6 - Ehdaa_Sakawi - javaScript - Week_2#453Ehdaa-Munier wants to merge 3 commits intoCodeYourFuture:mainfrom
Conversation
|
|
||
| function getMood() { | ||
| function getMood(isHappy) { | ||
| let isHappy = true; |
There was a problem hiding this comment.
Is this correct? When you ran your unit tests locally did they pass for you?
|
|
||
| function greaterThan10(num) { | ||
| let isBigEnough; | ||
| let isBigEnough = num >= 10; |
There was a problem hiding this comment.
Looks good but here's a question: Is num >= 10 going to assert that the num is greater than 10?
| function isAcceptableUser(userAge, isLoggedIn) { | ||
| if (userAge >= 18 && isLoggedIn){ | ||
| return "is acceptable" | ||
| } | ||
| } |
There was a problem hiding this comment.
Not bad but do we need to know when user is not acceptable?
| function applyDiscount(totalPrice) { | ||
| if(totalPrice>200){ | ||
| discount=10;} | ||
| else{ discount=5; | ||
|
|
||
| } | ||
| return totalPrice-( totalPrice * discount / 100); |
There was a problem hiding this comment.
Good effort, can we make this code a bit more readable by formatting your if statement?
| function buyTwoGetTheCheapestFree(price1, price2) { | ||
| let totalPrice = price1 + price2; | ||
| if (price1 < price2){ | ||
| let discount = price1; | ||
| } | ||
| return totalPrice - price1; | ||
| } |
There was a problem hiding this comment.
When you ran your unit tests did they pass for you?
consider following
buyTwoGetCheapestFree(200,100) would your code still work correctly?
| } | ||
|
|
||
| /* | ||
| Complete the function so that it prints out to the console numbers in reverse order starting at |
There was a problem hiding this comment.
Looks like you have missed 1 more step of your assignment function countReverse(number) {}
Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in
HOW_TO_MARK.mdin the root of this repositoryYour Details
Homework Details
Notes
What did you find easy?
What did you find hard?
What do you still not understand?
Any other notes?