Merging linked Data in Array in Javascript
问题 I have a simple task of rearranging a couple of Arrays in a JSON, so ractive.js can handle it better. But I got carried away a bit, and the outcome was not particularly satisfactory. An example of my initial Array: [{ "_id": 1, "type": "person", "Name": "Hans", "WorksFor": ["3", "4"], }, { "_id": 2, "type": "person", "Name": "Michael", "WorksFor": ["3"], }, { "_id": 3, "type": "department", "Name": "Marketing" }, { "_id": 4, "type": "department", "Name": "Sales" }, { "_id": 5, "type": "person