Dina JavaScript, anjeun tiasa nyaring array objék ngagunakeun Array.filter() metoda. Metode ieu nyiptakeun array anyar kalayan sadaya unsur anu lulus tés anu dilaksanakeun ku fungsi anu disayogikeun. Ieu conto: `` const people = [ { nami: 'Alice', umur: 30 }, { nami: 'Bob', umur: 25 }, { nami: 'Charlie', umur: 35 }, { nami: 'David', umur: 40 }; // Filter jalma anu umurna langkung ageung atanapi sami sareng 35 const filteredPeople = people.filter(person.person.age >= 35); console.log(Filter People); // [{ nami: 'Charlie', umur: 35 }, { nami: 'David age: 40 } ``` In the example above, we have an array of objects with age and properties.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence