[Solved] Using jQuery deferred and promise inside loop

I think you can do something as simple as this: var sortedArray = [AList, BList, CList, DList]; Promise.all(sortedArray.map(function(value) { var url = …; return getListItems(url); })).then(function(results) { // results is an array of results from AList, BList, CList, DList in order let allJsonData = []; results.forEach(function(approvedListItems) { allJsonData.push.apply(allJsonData, approvedListItems.d.results); }); // process allJsonData here }); … Read more

[Solved] Javascript accessing nested properties of an object literal

The line el.setAttribute(key, [key]); tries to set the attribute to an array containing the key as its only entry (and thus will set href to “href” since the array will get coerced to string). You probably meant el.setAttribute(key, obj.att[key]); // ——————^^^^^^^ Live Example: function hoistNav() { const nav = []; nav[0] = {text: ‘HOME’, att: … Read more