JavaScirpt: Filter data from array based on index : I have an multidimensional array and want to filter is based on value at particular index value its look something like this : 


<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->


    arr = [
           [id, postID , title , like ],
           [1 , 101 , 'New post ', 0],
           [2 , 101 , 'New Post' , 1],
           [3 , 102 , 'another post' ,0],
           [4 , 101 , 'New post' ,1],
           [5 , 102 , 'another post' , 1],
           [6 , 103 , 'third post' ,1]
    ]

<!-- end snippet -->

I want to filter this array based on postId and get the sum of like with title(as title is same for same postId)and individual array of each, want the result like :


<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->


    result_arr = [
           [101 , 'New post', 2],
           [102 , 'another post' ,1],
           [103 , 'third post' ,1]
    ]

    post_id_arry = [101, 102 , 103]
    title_array = ['New post' ,'another post','third post' ]
    likes_array - [2,1,1]

<!-- end snippet -->

