Daren Larson - #454
Conversation
| let lastCar = 0; | ||
| console.log(); | ||
|
|
||
| let lastCar = inventory.length - 1; |
There was a problem hiding this comment.
Good use of the lastCar variable, which caused a lot of confusion.
| for(let i = 0; i < inventory.length; i++) { | ||
| carModels.push(inventory[i].car_model); | ||
| } | ||
| let sortedCarModels = carModels.sort(); |
There was a problem hiding this comment.
sort function actually mutates the original array. What it means is that you don't need to store the return value of the sort function in another variable. As a matter of fact sort function returns the original array i.e. in this case sortedCarModels === carModels would return true.
| } | ||
|
|
||
| // Write your intern objects here: | ||
| const Mitzi = { |
There was a problem hiding this comment.
It is conventional to use camelCase for variable names. Why does it matter? Conventions allow for better communication between developers. If you see a camel-cased variable you know that the developer probably intended it to be the name of a function or a variable. PascalCase is used for naming special functions called constructor functions. You will learn more about this soon.
|
|
||
| // Antonietta loves math, give her the ability to multiply two numbers together and return the product. Use the console.log provided as a hint. | ||
| //console.log(antonietta.multiplyNums(3,4)); | ||
| Antonietta.multiplyNums = function(parameter1, parameter2) { |
There was a problem hiding this comment.
Using descriptive names instead of parameter1 will add to better documentation.
No description provided.