JavaScript-da obyektlar massasini Array.filter() usuli yordamida filtrlash mumkin, bu esa berilgan funksiya tomonidan amalga oshirilgan testni o'tkazib yuborgan barcha elementlar bilan yangi massiv yaratadi. Mana bir misol: const people = [ { name: 'Alice', age: 30 }, { name: 'Bob', age: 25 }, { name: 'Charlie', age: 35 } ]; // 30 dan katta bo'lganlarni filtrlash constedPeople = people.filter.{ person => person.age > 30); console.logfiltered.{ people }); // Output: [{ name: 'Charlie', age: 35 }] Ushbu misolda bizda nom va yosh xususiyatlari bo'lgan ob'ektlar massasini mavjud. Biz filtrlash usulidan foydalanib, yangi filtrlangan People massivini yaratamiz, u faqat 30 dan katta
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence