London9-Lovelace-Mohamed Abdi-JavaScript-Core-1-Coursework-Week1 - #449
London9-Lovelace-Mohamed Abdi-JavaScript-Core-1-Coursework-Week1#449MohamedAbdi114 wants to merge 2 commits into
Conversation
JDysiewicz
left a comment
There was a problem hiding this comment.
all looks great; couple things about using let/const instead of var, however all looks really good - nicely done! :D
| // Start by creating a variable `message` | ||
|
|
||
| const message = "This is a string." | ||
| var messageType = typeof message; |
There was a problem hiding this comment.
try to get into the habit of using const instead of var for all variables. Then, if the variable does need to change, you can declare it with let instead. Try to avoid var, as this can cause lots of issues with scoping (https://www.freecodecamp.org/news/var-let-and-const-whats-the-difference/, but don't worry about the details for now)
| @@ -1,2 +1,6 @@ | |||
| var numberOfStudents = 15; | |||
| var numberOfMentors = 8; | |||
| var Total = numberOfStudents + numberOfMentors; | |||
There was a problem hiding this comment.
by convention, variables in JavaScript are lowerCamelCase; variables that start with capital letters usually refer to a class (a data structure that you will learn about soon).
| @@ -1,5 +1,7 @@ | |||
| // Declare your function first | |||
| function divide(a,b) { | |||
| return a/b | |||
There was a problem hiding this comment.
As a thought, what would happen if b = 0? Your code would try and execute a / 0 - try this and see what happens. This leads onto a nice way of programming called "defensive programming"
| "jest-extended": "^0.11.5" | ||
| } | ||
| }, | ||
| "main": "index.js", |
There was a problem hiding this comment.
something whacky definitely occurred here with your npm; hopefully the discussions we've had will help resolve things
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 JS-week1
Notes
What did you find easy?
What did you find hard?
What do you still not understand?
Any other notes?
@JDysiewicz