From 969af4adfdfaad5b2ead7e148863ca5756123ae0 Mon Sep 17 00:00:00 2001 From: bytesparallel Date: Wed, 6 Oct 2021 11:38:44 -0500 Subject: [PATCH] fixed array declaration --- scripts/leonids-toys.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/scripts/leonids-toys.js b/scripts/leonids-toys.js index 0d4e5c0..da43c7d 100644 --- a/scripts/leonids-toys.js +++ b/scripts/leonids-toys.js @@ -1,21 +1,23 @@ -const createtoyobj = (number,toyname, typename, unitprice, stockst,description,toyman ) => { - return { - id: number, - name: toyname, - type: typename, - price: unitprice, - stockstatus: stockst, - itemdescription: description, - manufacturer: toyman + +const toys = [ + const createtoyobj = (number,toyname, typename, unitprice, stockst,description,toyman ) => { + return { + id: number, + name: toyname, + type: typename, + price: unitprice, + stockstatus: stockst, + itemdescription: description, + manufacturer: toyman } } +] - -const buildingBlocks = createtoyobj(1, "building blocks", "construction toy", `${50.00}`,true,"Quality building blocks for inquiring and creative minds", "Hasboro"); -const hotWheels = createtoyobj(2,"hot wheels set", "toy vehicles",`${100.00}`, true, "Beautifully painted model cars! Durable and will keep children entertained for hours. (Not for children under the age of 5, small parts/swallowing hazard", "Mattel"); -const stuffedAnimals = createtoyobj(3,"Beanie Babies", "Stuffed Animals", `${15.00}`, false, "Soft, plushy, and cute! Perfect for infants all the way up to 7 years old!", "Beanie Babies"); +const buildingBlocks = toys.createtoyobj(1, "building blocks", "construction toy", `${50.00}`,true,"Quality building blocks for inquiring and creative minds", "Hasboro"); +const hotWheels = toys.createtoyobj(2,"hot wheels set", "toy vehicles",`${100.00}`, true, "Beautifully painted model cars! Durable and will keep children entertained for hours. (Not for children under the age of 5, small parts/swallowing hazard", "Mattel"); +const stuffedAnimals = toys.createtoyobj(3,"Beanie Babies", "Stuffed Animals", `${15.00}`, false, "Soft, plushy, and cute! Perfect for infants all the way up to 7 years old!", "Beanie Babies"); console.log(buildingBlocks); console.log(hotWheels);