อะไร í ระเมินตัวเองสูงเกินสำหรับแต่ละ

รหัสตัวอย่าง

0
0

ยังไง forEach&ลูกศรกฟังก์ชันทำงาน?

const products = [
    { name: 'laptop', price: 32000, brand: 'Lenovo', color: 'Silver' },
    { name: 'phone', price: 700, brand: 'Iphone', color: 'golden' },
    { name: 'watch', price: 3000, brand: 'Casio', color: 'Yellow' },
    { name: 'sunglass', price: 300, brand: 'Ribon', color: 'blue' },
    { name: 'camera', price: 9000, brand: 'Lenovo', color: 'gray' },
];
//Total Products Price by Using forEach
let totalPrice = 0;
products.forEach(product => {
    totalPrice += product.price;
})
console.log(totalPrice);
//Expected output: 45000
0
0

สำหรับแต่ละเรื่องกับ arrowfunction

someValues.forEach((element) => {
    console.log(element);
});

OR

someValues.forEach((element, index) => {
    console.log(`Current index: ${index}`);
    console.log(element);
});

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................