1const products = [
2 { name: 'Laptop', price: 32000, brand: 'Lenovo', color: 'Silver' },
3 { name: 'Phone', price: 700, brand: 'Iphone', color: 'Golden' },
4 { name: 'Watch', price: 3000, brand: 'Casio', color: 'Yellow' },
5 { name: 'Aunglass', price: 300, brand: 'Ribon', color: 'Blue' },
6 { name: 'Camera', price: 9000, brand: 'Lenovo', color: 'Gray' },
7];
8//Total products price by using Map
9let total = 0;
10const getPrice = products.map(product => {
11 total = total + product.price;
12});
13console.log(total)
14//Expected outPut: 45000
1const exampleArray = ['aa','bbc','ccdd'];
2console.log(exampleArray.map(a => a.length));
3//Would print out [2,3,4]