How can I combine two different JSON responses into one object so I can manipulate my data from a single source?
I've read different implementations, however not quite the way I have my code structured right now.
I'm pretty green on it, so if you can provide me a hands-on example that would be greatly appreciated.
ex:
$(function() {
let hotels = 'data1.json';
let guests = 'data2.json';
$.getJSON(hotels)
.then(function (res) {
console.log(res);
})
.fail(function (err) {
console.log(err);
});
$.getJSON(guests)
.then(function (res) {
console.log(res);
})
.fail(function (err) {
console.log(err);
});
/*** start logic for application here ***/
let newObject = //How can I combine both responses above???
console.log(newObject);
});
