---
title: "Yatheesh (@yatheesh) | Hashnode"
description: "Engineer . Web Developer and more . Read the latest articles by Yatheesh on Hashnode."
url: "https://hashnode.com/@yatheesh"
---

@yatheesh

# Yatheesh

@yatheesh · India · Joined February 2021

Engineer . Web Developer and more .

[Website](https://yatheesh.dev/)

## Comments

[Flattening an array is nothing but returning only selected items in the form of array . we can push only the needed value instead of the item . see the example below const utubers=\[{id:1,name:'Test Ed',sal:5000},{id:2,name:'Dev Ed',sal:5000},{id:3,name:'Mr Beast',sal:2000},{id:4,name:'Mr Boss',sal:2000},{id:5,name:'MKBHD',sal:5000}\] const salGt2000ids = utubers.reduce(((tempArray,utuber)=>{ // get an array with only whose sal is more than 2000 if(utuber.sal>2000){ tempArray.push(utuber.id) } return tempArray; } ),\[\]) console.log(salGt2000ids); //\[1, 2, 5\]](https://hashnode.com/posts/use-javascript-reduce-function-for-more-than-sum/602cd60f2d9e060f1cee6b2a/comment/602dcdca094669172f4d0c0f#reply-602e0ae7797c7f1cb42b1da0)

Reply · Article · Feb 18, 2021 · [Use JavaScript reduce function for more than sum](https://hashnode.com/posts/use-javascript-reduce-function-for-more-than-sum/602cd60f2d9e060f1cee6b2a)
