Conversation
| // Once your objects are created, log out the following requests from HR into the console: | ||
|
|
||
| // Mitzi's name | ||
| console.log(companyIntern1.name) |
| console.log(companyIntern5.multiplyNums(3,4)); | ||
|
|
||
| // === Great work! === Head over to the the arrays.js file or take a look at the stretch challenge | ||
|
|
| // ==== Challenge 1 ==== | ||
| // The dealer can't recall the information for a car with an id of 33 on his lot. Help the dealer find out which car has an id of 33 by logging the car's year, make, and model in the console log provided to you below: | ||
| console.log(`Car 33 is a *car year goes here* *car make goes here* *car model goes here*` ); | ||
| console.log(`Car 33 is a `, inventory[33].car_year, inventory[33].car_make, inventory[33].car_model ); |
There was a problem hiding this comment.
Don't forget that the index starts at 0 rather than 1 - so car 33 is actually at index 32.
| console.log(); | ||
|
|
||
| for(let i = 0; i < inventory.length; i++){ | ||
| inventory[i].id; |
There was a problem hiding this comment.
This works without inventory[i].id;
| } | ||
| } | ||
| console.log("this is the list of all bmw and audi cars: " + JSON.stringify(BMWAndAudi)); | ||
|
|
There was a problem hiding this comment.
Using === may cause issues down the line with conflicting types, in this case == would be better.
|
|
||
| } | ||
| } | ||
| console.log(oldCars.length); |
| return cb(true); | ||
| } | ||
| } | ||
| return cb(false); |
nphillips78
left a comment
There was a problem hiding this comment.
Great job overall! Looks like you are pretty comfortable with the concepts you're learning.
For reference:
https://developer.mozilla.org/en-US/docs/Glossary/Type_Conversion
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array (look under Accessing Array Elements)
Keep up the good work!
|
@ujaved931 I edited the task list in the first comment at the top ☝️ Now it shows up as a clickable list, AND in the main PR list, you have a progression bar next to your PR 😄 The diff was you had |
##JS1
objects.js
arrays.js
callbacks.js
Stretch Task
Good Habits