© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Emil Moe
Senior Data Engineer
ArrayOfObj.reduce((accumulator, current) => { if (current.age !== 30) { return; } accumulator.push(current.name); return accumulator; }, []);
Krish Singh
I am not the best but no one is better than me
let arr = []; ArrayOfObj.forEach( o => { if( o.age == 30 ){ arr.push(o.name) } }) OR ArrayOfObj.filter(obj=> obj.age==30).map(obj=> obj.name )