how to search through two json file to find a match

I am trying to compare two large json file and return matches on json file A has this structure “x4mps” : { “Address” : “genesis may WAY”, “CageEstablished” : “10/04/1909”, “CageExpires” : “06/02/2023”, “CageUpdate” : “06/09/2008”, “City” : “lansdown”, “Country” : “UNITED STATES”, “Fax” : “72827974”, “POC” : “John Woodcock”, “Phone” : “4245255”, “SAMExpires” :…

How can I import a json file in a JavaScript file?

I have two files data.json and index.js. data.json looks like this: { “stacy”: { “age”: 24, “name”: “Stacy”, “properties”: [ “crazy”, “funny”, “straight” ] }, “john”: { “age”: 41, “name”: “John”, “properties”: [ “experienced”, “direct”, “straight” ] }, } How can I import data.json into index.js? I thought about something like this: import * as…

Angular4 loop through returned JSON object in .subscribe using typescript

I’m using http post in angular 4 to return a json object from an external API. Here is my function in typescript getImages() { this.http.post(‘http://www.detdev.co.uk/photoapp/api/getFramesApp’, { title: ‘foo’, body: ‘bar’, userId: 1 }) .subscribe( res => { console.log(res); }, err => { console.log(“Error occured”); } ); } I’m having trouble looping through the “res”, which…