ZA2-B Ogundele-JS Core1-Coursework-Wk1 - #336
Conversation
Completed exercises B to F
I attempted X1 mandatory exercise to see if the test passed and it did
I finally got these exercises to run correctly in Node!!!
I worked on the above and am ready to commit these changes
chandredewet
left a comment
There was a problem hiding this comment.
Hi Berenice,
I have indicated some changes to be made to your repo, but most of your code indicates that you do understand fundamentals. Not much to change. Keep on keeping on!
| // const message = name.trim(); | ||
|
|
||
| // console.log(message); | ||
| // //was not sure if i should combine the X2 exercises No newline at end of file |
There was a problem hiding this comment.
Not sure either, but great use of .trim(), good method to remember
| @@ -1,2 +1,7 @@ | |||
| var numberOfStudents = 15; | |||
| var numberOfMentors = 8; | |||
| var numberOfStudents = 15 / 23; | |||
There was a problem hiding this comment.
Just a tip to keep the original request before you change it. Its not wrong but just helps for troubleshooting. So for e.g. perhaps you could have had:
var numberOfStudents = 15 ;
numberOfStudents = 15/23
Also need to multiply by 100 to get percentage before using Math.round. So perhaps in addition
studentsPercentage = Math.round(numberOfStudents * 100)
console.log( {studentsPercentage}% )
| // Complete the function so that it takes input parameters | ||
| function multiply() { | ||
| function multiply(num1, num2) { | ||
| // Calculate the result of the function and return it |
There was a problem hiding this comment.
Inside the function the calculation needs to occur and answer be returned.
return num1 * num2
| return "The total is total"; | ||
| return "The total is " + total; | ||
| } | ||
|
|
There was a problem hiding this comment.
great understanding of the fundamentals in this exercise
| function multiply(a, b, c) { | ||
| a * b * c; | ||
| return; | ||
| return a + b + c; |
There was a problem hiding this comment.
This is syntactically correct, just instead of pluses it should have been multiplication
| console.log(one + two + three); | ||
| // Write the body of this function to concatenate three words together. | ||
| // Look at the test case below to understand what this function is expected to return. | ||
| } |
There was a problem hiding this comment.
this definitely will work, but the requirement asks you to use the concat function used just before.
|
|
||
| function getStringLength(word) { | ||
| return "word".length(); | ||
| return word.length(); |
There was a problem hiding this comment.
Hi. This one is similar to the top in exercises, where u got the trim function right.
|
|
||
| function getStringLength(word) { | ||
| return "word".length(); | ||
| return word.length(); |
There was a problem hiding this comment.
here length is a property not a method, that is it should not have () parenthesis after the word.
chandredewet
left a comment
There was a problem hiding this comment.
if you edit the few mandatory items that are wrong and rerun tests and submit. this repo should work again
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/D-strings/README.md