groupBy count in lodash

data(){
productValue:[
   {
  localData: '8/13/2017'
   },
   {
  localData: '8/13/2017'
   },
   {
  localData: '6/13/2017'
   },
   {
  localData: '5/13/2017'
   }
 ]
},
computed:{
 productVal(){
 var vm = this
  return  _.countBy(vm.productValue, function(o){
   return moment(o.localData).format('MM');
  }); 
 },
 
  },
//{ "08": 2, "06": 1, "05": 1 }

No comments:

What is Security Engineering? Part 2.

A broad overview of the ever-developing security engineering field; a domain that can feel intimidating to some software engineers. With Nie...

Contact Form

Name

Email *

Message *