NW5 Manchester - Ahmed Mohamed - JS1 - Week 1 - #375
Conversation
AltomHussain
left a comment
There was a problem hiding this comment.
Overall great work Ahmed looks good, well done!! Just remember to add comments to all of your functions, it is just a really handy way of making your code more readable for your and other people :)
| function getStringLength(word) { | ||
| return "word".length(); | ||
| word = " CodeYourFuture "; | ||
| word = " CodeYourFuture teaches coding "; |
There was a problem hiding this comment.
You did not need to assign word in lines 7 and 8, because work parameter is coming from the test below. So all you need is to handle what's inside the function.
At the moment lines 7 & 8 are useless because the function is not picking the "word" Parameter from lines 7 &8 but it is picking from the argument that's been passed from below in the tests
| function multiply(a, b, c) { | ||
| a * b * c; | ||
| return; | ||
|
|
There was a problem hiding this comment.
Also, delete these empty lines before return and perhaps add empty lines between the functions to make it more readable.
| } | ||
|
|
||
| // Add comments to explain what this function does. You're meant to use Google! | ||
|
|
There was a problem hiding this comment.
Here is suggesting you add comments to explain what the functions are doing, so you should probably spend some time writing some comments
| } | ||
|
|
||
| function concatenate(firstWord, secondWord, thirdWord) { | ||
| return firstWord+" "+secondWord+" "+thirdWord; |
There was a problem hiding this comment.
It will be really readable and nicer if you can add spaces between your strings and variables here like so:
return firstWord + " " + secondWord + " " + thirdWord;
|
|
||
| function calculateSalesTax() {} | ||
| function calculateSalesTax(price) { | ||
| let salesTax=(price*20)/100; |
There was a problem hiding this comment.
Again spaces between your variables to make it easy to read.
| */ | ||
|
|
||
| function addTaxAndFormatCurrency() {} | ||
| function addTaxAndFormatCurrency(tax) { |
There was a problem hiding this comment.
Really good reusability for the function created above good stuff :)
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?