Skip to content

Simon Davis [JavaScript-I]#80

Open
Skidragon wants to merge 7 commits intobloominstituteoftechnology:masterfrom
Skidragon:master
Open

Simon Davis [JavaScript-I]#80
Skidragon wants to merge 7 commits intobloominstituteoftechnology:masterfrom
Skidragon:master

Conversation

@Skidragon
Copy link

No description provided.

Copy link

@holly-g holly-g left a comment

Choose a reason for hiding this comment

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

Great job, Simon!

console.log(`Car 33 is a *car year goes here* *car make goes here* *car model goes here*` );
for(let i = 0; i < inventory.length; i++) {
if (inventory[i].id === 33) {
console.log(`Car 33 is a ${inventory[i].car_year} ${inventory[i].car_make} ${inventory[i].car_model}` );
Copy link

Choose a reason for hiding this comment

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

This works with just the template literal, no for loop necessary, with an index of 32, not 33. Don't forget that the index starts at 0 instead of 1.

oldCars.push(carYears[i]);
}
}
console.log(oldCars);
Copy link

Choose a reason for hiding this comment

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

Don't forget you need to log its length.

let BMWAndAudi =[];
console.log();
for(let i = 0; i < inventory.length; i++) {
if(inventory[i].car_make === 'BMW' || inventory[i].car_make === 'Audi') {
Copy link

Choose a reason for hiding this comment

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

Consider using loose equality == as opposed to strict equality ===.

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