Skip to content

Comments

Ben Masterson - Finished Javascript-I#326

Open
bennybooftw wants to merge 4 commits intobloominstituteoftechnology:masterfrom
bennybooftw:master
Open

Ben Masterson - Finished Javascript-I#326
bennybooftw wants to merge 4 commits intobloominstituteoftechnology:masterfrom
bennybooftw:master

Conversation

@bennybooftw
Copy link

No description provided.

Copy link

@John-Spraul John-Spraul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Git stuff
  • Finished assignment

🎉 Good work!

// The dealer needs the information on the last car in their inventory. What is the make and model of the last car in the inventory? Log the make and model into the console.
let lastCar = 0;
console.log();
let lastCar = 49;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

best to use inventory.length - 1 to account for any length



for (let i = 0; i < inventory.length; i++) {
if (inventory[i].car_make == "BMW" || inventory[i].car_make == "Audi") {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you asked for a shorter version of writing this or; consider:

if (['BMW','Audi'].includes(inventory[i].car_make)) { ...

"age": 30
}
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's possible to define methods inside the object itself, this would be a good wayto solve this Stretch problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants