updating toy changes for filter

This commit is contained in:
2021-10-07 14:07:58 -05:00
parent 8310d48b47
commit 0dc0171f44
+25 -21
View File
@@ -1,26 +1,25 @@
const toys = []
const createtoyobj = (number,toyname, typename, unitprice, stockst,description,toyman ) => {
const newOBJ = {
id: number,
name: toyname,
type: typename,
price: unitprice,
stockstatus: stockst,
itemdescription: description,
manufacturer: toyman
const createtoyobj = (number, toyname, typename, unitprice, stockst, description, toyman) => {
const newOBJ = {
id: number,
name: toyname,
type: typename,
price: unitprice,
stockstatus: stockst,
itemdescription: description,
manufacturer: toyman
}
return newOBJ
}
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 = 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");
/* for (const toy of toys) {
@@ -47,13 +46,18 @@ for(stuffedAnimal of stuffedAnimals) {
}
*/
const dumptruck = createtoyobj(4,"dump truck", "toy vehicles", `${150.00}`, true, "High quality fully aluminum and steel construction!", "Tonka")
const dumptruck = createtoyobj(4, "dump truck", "toy vehicles", `${150.00}`, true, "High quality fully aluminum and steel construction!", "Tonka")
const racetrack = createtoyobj(5, "Race Track", "toy vehicles", `${200.00}`, false, "Fun place for kids to race their hotwheels!","Neumann" )
const racetrack = createtoyobj(5, "Race Track", "toy vehicles", `${200.00}`, false, "Fun place for kids to race their hotwheels!", "Neumann")
toys.push(dumptruck, racetrack,buildingBlocks, hotWheels, stuffedAnimals)
toys.push(dumptruck, racetrack, buildingBlocks, hotWheels, stuffedAnimals)
for (const toy of toys) {
toy.price = toy.price * 1.05
console.log(`The ${toy.name} costs ${toy.price}.`)
}
for(const toy of toys){
console.log(`The ${toy.name} costs ${toy.price}.`)
}