London10-StellaDelMar_RodriguezFernandez-JavaScript-Core-1-Coursework-Week2#457
London10-StellaDelMar_RodriguezFernandez-JavaScript-Core-1-Coursework-Week2#457Stelladelmar wants to merge 1 commit intoCodeYourFuture:mainfrom
Conversation
| //from 7 to 1 | ||
| let number = 7; | ||
| function countReverse(number) { | ||
| while (number >= 10 ){ |
There was a problem hiding this comment.
So for this one, using a while loop where will probably result in an infinite loop (more on this here), if the number is greater than 10. Otherwise, this will not run as the number would be less than 10 (for example in your number = 7 example, this wouldn't return anything because the number is less than 10).
You might want to think about using a for loop here:
for (let i = number; i > 0; i--)
| else if (age >= 90 ){ | ||
| return "You Don't Need To Register"; } | ||
|
|
||
| } |
| } else if (price2 > price1){ | ||
| return price2; | ||
| } | ||
| //console.log("price is"); |
There was a problem hiding this comment.
nice job using an if statement here.
LGTM! (here is the meaning if this acronym!)
| while (limit <= 10){ | ||
| console.log(limit); | ||
| } limit = limit + 1; | ||
| } |
There was a problem hiding this comment.
Looks like we might have another infinite loop here (docs here). Maybe have a quick review on how while loops work? they can be a bit tricky.
| //let totalPrice = 150; | ||
| function applyDiscount(totalPrice) { | ||
| if (totalPrice >200){ | ||
| return (totalPrice - totalPrice * 0.01); |
There was a problem hiding this comment.
nice job with the if statement!
Just might want to check your maths on this one 😉
0.01 would be 1% and 0.1 would be a 10%, but where is our 5% discount? 😜
| return true; | ||
| } else { | ||
| return false; | ||
| } |
|
Hi @Stelladelmar! Thanks for putting in this PR! That's great :) Very happy you were able to get this in and a lot of really good work! I can see you have really been practicing. I have left some comments for you. The one thing I would say you might want to take another look at is your while loops. We can review this concept if you have any questions, but in the meantime take a look back through the videos and some of the documentation. Again, great work and keep it up! Looking forward to your next one :) |
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?