JAVASCRIPT Telegram 2387
CHALLENGE

const products = [
{ id: 1, name: 'Laptop', price: 1200, category: 'Electronics' },
{ id: 2, name: 'Headphones', price: 100, category: 'Electronics' },
{ id: 3, name: 'Book', price: 15, category: 'Books' },
{ id: 4, name: 'Shirt', price: 25, category: 'Clothing' },
{ id: 5, name: 'Coffee Mug', price: 10, category: 'Kitchen' }
];

const result = products
.filter(p => p.price > 20)
.map(p => ({ name: p.name, value: p.price * 0.9 }))
.reduce((acc, item) => {
acc.names.push(item.name);
acc.total += item.value;
return acc;
}, { names: [], total: 0 });

console.log(result);
9👍2🔥1



tgoop.com/javascript/2387
Create:
Last Update:

CHALLENGE

const products = [
{ id: 1, name: 'Laptop', price: 1200, category: 'Electronics' },
{ id: 2, name: 'Headphones', price: 100, category: 'Electronics' },
{ id: 3, name: 'Book', price: 15, category: 'Books' },
{ id: 4, name: 'Shirt', price: 25, category: 'Clothing' },
{ id: 5, name: 'Coffee Mug', price: 10, category: 'Kitchen' }
];

const result = products
.filter(p => p.price > 20)
.map(p => ({ name: p.name, value: p.price * 0.9 }))
.reduce((acc, item) => {
acc.names.push(item.name);
acc.total += item.value;
return acc;
}, { names: [], total: 0 });

console.log(result);

BY JavaScript


Share with your friend now:
tgoop.com/javascript/2387

View MORE
Open in Telegram


Telegram News

Date: |

Done! Now you’re the proud owner of a Telegram channel. The next step is to set up and customize your channel. Select: Settings – Manage Channel – Administrators – Add administrator. From your list of subscribers, select the correct user. A new window will appear on the screen. Check the rights you’re willing to give to your administrator. Read now Administrators Invite up to 200 users from your contacts to join your channel
from us


Telegram JavaScript
FROM American