JSFiddle - React, Tailwind, and code Playground

JavaScript

var 
data = {
    people : [
        {name:'Caring', state:'Tn', price:'100'},
        {name:'Mo', state:'Ap', price:'200'},
        {name:'af', state:'Jk', price:'33'},
        {name:'adi', state:'Kl', price:'400'},
        {name:'Hu', state:'Ka', price:'600'}
    ]
},
    
    OrderItem = function(person){
        this.person = person
        getSummary = function(){
          return  person.name
            + ' spent '
            + person.price
            + ' in ' + person.state + '.';
        }
        
        return this;
    };
    
    OrderItem.prototype.data = function(){
        return this.person;
    }
    
    m = _.collect(data.people, function(value, key, list){
        return new OrderItem(value);
    })



_.each(m, function(value){
   // console.log(value.getSummary()); //works fine
    console.log(value.data()); //not working!
})