wm3/halla_Sulaiman-JavaScript-core1-week1 - #202
Conversation
Professional-Kate
left a comment
There was a problem hiding this comment.
These are all super simple and petty things, but that's because your code is already amazing. Amazing work, but a couple of small changes 🎉
| console.log(message); | ||
| const myName = " Daniel "; | ||
| let myNewName = myName.trim(); | ||
| let message1 = myNewName.length; |
There was a problem hiding this comment.
I'd like to see a more explicit variable name for this. Just so you can read the script and see exactly what this variable does, something like let newNameLength = myNewName.Length; or something better
| @@ -1 +1,6 @@ | |||
| console.log("Hello world"); | |||
| console.log("Hello World. I just started learning JavaScript!."); | |||
| console.log(Hello World. I just started learning JavaScript!.); // got a SyntaxError for this one . | |||
There was a problem hiding this comment.
Do you know why you got a SyntaxError for this line?
There was a problem hiding this comment.
Yes, Strings should be inside double or single quotes . The line above is the correct one , this line should've been commented out or deleted as it was originally there as a apart of the homework to be corrected I think . I forgot to do so .
| @@ -1,3 +1,16 @@ | |||
| // Start by creating a variable `message` | |||
| let myName = " Halla "; | |||
| let message = myName.length; | |||
There was a problem hiding this comment.
I'd like to see a more explicit variable name, while this works perfectly, it's harder to manage and read
|
|
||
| function shakeBall() { | ||
| //Write your code in here | ||
| expectedAnswers = [ |
There was a problem hiding this comment.
This variable is missing a const or let declaration
There was a problem hiding this comment.
Thank you Kate .As you can see , I declared it first outside of the function which makes it global . Then I changed my mind and moved it to the inside of the function without declaration , just trying to see if this would make it global from the inside of the function to be able to use it in the other function . tried both ways and both work .
|
Great work halla. |
|
Your coursework submission has been closed because nobody has interacted with it in six weeks. You are welcome to re-open it to get more feedback. |
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?