I have a requirement get the count of each account type in the array. 
I have tried normal way of looping the array and increment a counter for each 
account\_type. Could you please help me to do the same in **lodash or underscore js**. 

Your help is much appreciated. Thank you. 

```
input_array = [
    {
        account_id: '4304bf0381140b8fcccbdddea3571a53facebook',
        account_type: 'facebook'
    },
    {
        account_id: '4304bf0381140b8fcccbdddea332434facebook',
        account_type: 'facebook'
    },
    {
        account_id: '5824fb40c4a97e21ef9715ea69c1cfb9twitter',
        account_type: 'twitter'
    },
    {
        account_id: '5824fb40c4a97e21ef9715ea432423twitter',
        account_type: 'twitter'
    },
    {
        account_id: '2c13790be20a06a35da629c71e548afexing',
        account_type: 'xing'
    },
    {
        account_id: 'd1376b07b144130c4f041e223dfb1197weibo',
        account_type: 'weibo'
    },
    {
        account_id: 'd1376b07b144130c4f041e223df4343weibo',
        account_type: 'weibo'
    }
]
output_array = [
    {
        type: "facebook",
        count: 2
    },
    {
        type: "twitter",
        count: 2
    },
    {
        type: "xing",
        count: 1
    },
    {
        type: "weibo",
        count: 2
    }
]

```

Tried 

```
input_array.forEach(function(data){
    if(data.account_type=='facebook'){
        count++;//forfacebook
    }
});

```