From 48874f5e5eac1bad78368c552f3cdd8501ee8f1f Mon Sep 17 00:00:00 2001 From: Fitsumhelina Date: Fri, 29 Nov 2024 00:00:01 +0300 Subject: [PATCH] 60% complated --- .../day-1/functional-programing-exercise.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Exercises/day-1/functional-programing-exercise.js b/Exercises/day-1/functional-programing-exercise.js index bdaf557..901d783 100644 --- a/Exercises/day-1/functional-programing-exercise.js +++ b/Exercises/day-1/functional-programing-exercise.js @@ -52,17 +52,19 @@ const price =products.map((product) => product.price) // Find the first product which doesn't have a price value -const items = products.find ((product) => product.price === '') -if (items){ - console.log(items.product) -} - else{ - console.log('No product with price value') - } +// const items = products.find ((product) => product.price === '') +// if (items){ +// console.log(items.product) +// } +// else{ +// console.log('No product with price value') +// } + // Find the index of the first product which does not have price value -const product = products.indexOf ((product) => product.price === undefined) +// const product = products.indexOf ((product) => product.price === undefined) // Check if some products do not have a price value +const items = products.some((product) => product.price === '' ) // Check if all the products have price value