JSFiddle - React, Tailwind, and code Playground

by vaheed akhtar

JavaScript

let array = [
{uniqu_id:'23',name: "this is name1", title:"This is title 2"},
{uniqu_id:'42',name:"this is name2", title:"This is title1"}];
console.log(array)
/* let newArray = array.map(function(item) { 
    delete item.name; 
    return item; 
}); */
let newArr2 = array.map(({uniqu_id,title,name})=>({title,uniqu_id}))
 console.log(newArr2)