DEV Community

aoguzie
aoguzie

Posted on

Dynamically merge all objects in different arrays (appending names instead of ignoring)

I want to combine two arrays with common properties:

var ranking = [{
    def: "0.58"
    league: "Scottish Premiership",
    name: "Celtic",
    off: "3.33",
    grank: "3",
    tform: "96.33",
},
{
    def: "2.52",
    league: "Scottish Premiership",
    name: "Dundee",
    off: "1.28",
    grank: "302",
    tform: "27.51",
}]
var matches = [{
date: "2010-04-22",
league: "Scottish

Top comments (0)