completed filter project

This commit is contained in:
2021-10-07 14:22:37 -05:00
parent 0dc0171f44
commit 9f46cf30ba
+5 -4
View File
@@ -52,11 +52,12 @@ const racetrack = createtoyobj(5, "Race Track", "toy vehicles", `${200.00}`, fal
toys.push(dumptruck, racetrack, buildingBlocks, hotWheels, stuffedAnimals)
toyID = 1
for (const toy of toys) {
toy.price = toy.price * 1.05
console.log(`The ${toy.name} costs ${toy.price}.`)
if(toyID === toy.id){
toy.price = toy.price * 1.05
console.log(`The ${toy.name} costs ${toy.price}.`)
}
}