London 9 Turing -Farnoosh Moayeri-JS-Week-1 - #458
Conversation
jonnywyatt
left a comment
There was a problem hiding this comment.
Great job! If you'd like to push on further, try running the tests in the mandatory folder 👏
| function createGreeting(name) { | ||
| return greet + name; | ||
| } | ||
| var greet = "Hello, my name is "; |
There was a problem hiding this comment.
It's better that this variable declaration moves inside the createGreeting function.
Also const is preferable to var in this case as a variable declared with const can't be overwritten.
| } | ||
|
|
||
| function greetingMentors(names) { | ||
| return `HELLO ${namesUpperCase(names)}`; |
| } | ||
| function getTotal(a, b) { | ||
| total = a ++ b; | ||
| total = a + b; |
There was a problem hiding this comment.
It's better to use const in front of the variable name, so it's not global, and can't be redeclared.
|
|
||
| function calculateSalesTax() {} | ||
| function calculateSalesTax(priceOfProduct) { | ||
| const salesTax = 0.2 * priceOfProduct; |
|
|
||
| function addTaxAndFormatCurrency() {} | ||
| function addTaxAndFormatCurrency(priceOfProduct) { | ||
| return "£".concat(calculateSalesTax(priceOfProduct).toFixed(2)); |
There was a problem hiding this comment.
There's a lot happening in this line, maybe separate it into 2 lines so it's easier to read. eg first line - call calculateSalesTax
second line - make the formatted string (you could use a string template?)
|
@jonnywyatt Hi, thank you very much for reviewing my codes. I will correct them. |
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? Using let, const.
What did you find hard? Find good names for variables.
What do you still not understand?-
Any other notes? No
View rendered exercises/D-strings/README.md
View rendered exercises/E-strings-concatenation/README.md