north-west-5/shimen-afshar/javascript-week1 - #392
Conversation
EABarton123
left a comment
There was a problem hiding this comment.
this looks really good, the only thing I would suggest is not to use var as it is outdated javascript. I agree it's hard to remember when some of the exercises are using it, but the code your future guidelines just ask to not use it.
Doris-Siu
left a comment
There was a problem hiding this comment.
Hi Shimen, very good job in using camelCase in naming your variables, and the code you wrote is very precise and concise:)
Please aware that we don't use var to declare variables anymore (use const/let instead) and some minor typos (as it might confuse other programmers.)
| @@ -1,3 +1,5 @@ | |||
| // Start by creating a variable `greeting` | |||
|
|
|||
| var greeting = "Helo World" | |||
| const name = " Daniel "; | ||
|
|
||
| console.log(message); | ||
| const convertetName = name.trim(); |
There was a problem hiding this comment.
Are you trying to mean "convertedName" in the variable name? I am not sure.
|
|
||
| function calculateSalesTax() {} | ||
|
|
||
| const TAX_RATE = 0.2; |
There was a problem hiding this comment.
Is there any special meaning to capitalize this variable particularly?
If no, I would suggest follow the camelcase guideline in naming.
| const name = " Daniel "; | ||
|
|
||
| console.log(message); | ||
| const convertetName = name.trim(); |
There was a problem hiding this comment.
Hi, you can also do console.log(message. trim()).
| const TAX_RATE = 0.2; | ||
|
|
||
| function calculateSalesTax(price) { | ||
| let tax = price * TAX_RATE; |
There was a problem hiding this comment.
HI, for the variable TAX_RATE we can use camelcase like - taxRate. or you can avoid declaring the variable as well for that the code should be - function calculateSalesTax(price) {
let salestax = (price * 0.2)
return price + salestax;
}
well done. Keep it up
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?
View rendered exercises/B-hello-world/README.md