From 9f46cf30baf5d1d716320125ca40a4cf82a79772 Mon Sep 17 00:00:00 2001 From: bytesparallel Date: Thu, 7 Oct 2021 14:22:37 -0500 Subject: [PATCH] completed filter project --- scripts/leonids-toys.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/leonids-toys.js b/scripts/leonids-toys.js index 211ffa5..f160270 100644 --- a/scripts/leonids-toys.js +++ b/scripts/leonids-toys.js @@ -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}.`) + } }