Glasgow Class 6 - Cat Smith -JS1-Week 1#538
Glasgow Class 6 - Cat Smith -JS1-Week 1#538CatSmith1 wants to merge 4 commits intoCodeYourFuture:masterfrom
Conversation
|
Cat Smith Module: JS1 |
Dedekind561
left a comment
There was a problem hiding this comment.
Hello @CatSmith1 ,
Well done on submitting your first piece of JS coursework.
My main piece of advice is around variable names and declarations - I've left a few comments for you to think about.
Good job!
| total = a + b; | ||
|
|
||
| return "The total is total"; | ||
| return `The total is ${total}`; |
There was a problem hiding this comment.
Nice job using template literals here 👍
| */ | ||
|
|
||
| function calculateSalesTax() {} | ||
| function calculateSalesTax(a) { |
There was a problem hiding this comment.
You've used a as a parameter name here. But this doesn't offer insight into what the parameter represents. Remember your code is designed to be read by others so always try to convey meaning when you choose variable names - sometimes this can be tricky!
|
|
||
| function calculateSalesTax() {} | ||
| function calculateSalesTax(a) { | ||
| subTotal = a * .2; |
There was a problem hiding this comment.
| subTotal = a * .2; | |
| let subTotal = a * .2; |
When declaring your variables, you've ommitted the let/const keyword. This will still work but for reasons you'll learn about later this is bad practice ( you'll almost always declare variables with let/const )
|
|
||
| function addTaxAndFormatCurrency() {} | ||
| function addTaxAndFormatCurrency(a) { | ||
| subTotal = a * .2; |
There was a problem hiding this comment.
Same thing here with let/const
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?