First Submission - all initial challenges completed not including stretch tasks#432
First Submission - all initial challenges completed not including stretch tasks#432gittc100 wants to merge 3 commits intobloominstituteoftechnology:masterfrom
Conversation
| console.log(kennan["id"]); | ||
| console.log(keven["email"]); | ||
| console.log(gannie["name"]); | ||
| console.log(antonietta['gender']); |
There was a problem hiding this comment.
Keep in mind that bracket notation isn't necessary here; you could've used dot notation like this:
console.log(keven.email);| } | ||
| for(let i = 0; i < carYears.length; i++){ | ||
| console.log(carYears[i]); | ||
| } |
There was a problem hiding this comment.
You could log the cars as you push them here (so that you don't have to loop twice):
for(let i = 0; i < inventory.length; i++){
carYears.push(inventory[i]["car_year"]);
console.log(carYears[i]);
}
assignments/arrays.js
Outdated
| console.log(); | ||
| for(let i = 0; i < carYears.length; i++){ | ||
| if(carYears[i] < 2000){ | ||
| oldCars.push(carYears); |
There was a problem hiding this comment.
This isn't pushing the car years! It's instead pushing the whole carYears array multiple times, so the length still adds up. Use carYears[i].
| exampleArray = [1,2,3,4]; | ||
| const triple = exampleArray.map((num) => { | ||
| return num * 3; | ||
| }); |
There was a problem hiding this comment.
Since you only have a single statement/expression that you're returning in your map callback, you could shorten it (by loosing the braces and the return keyword):
const triple = exampleArray.map((num) => num * 3);You can also lose the parentheses if you only have a single parameter (and you're not doing anything fancy with it):
const triple = exampleArray.map(num => num * 3);
No description provided.