JSFiddle - React, Tailwind, and code Playground

by touqeer hassan

JavaScript

var collection = [{name:'user1',phone:'203'},
                  {name:'user2',phone:'5050'},
                  {name:'user1',phone:'203'}]
collection.forEach((item)=>{
item.rowMatch = (collection.filter((e)=>{return (e.name==item.name&&e.phone==item.phone)}).length>1)?'true':'false';
})
console.log(collection)