Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Calling a function inside reduce / jQuery


My webpage isn't Loading. However, if i moved the $(".datacards").append(html) into the displayResults Function, everything loads fine. I just wanted to Reduce all the calls into 1 string with reduce and then append it once, like in my code below. Except, it's not loading when I have it set up like this. Any help would be appreciated. Thanks.

let streamers = [

function getStreamers() {
// var html = "";
var channelsAPI = "";
var streamsAPI = "";
var html = streamers.reduce(function(str, streamer) {
$.getJSON(channelsAPI + streamer, function(data) {
str += displayResults(
}, "");

function displayResults(display_name, name, logo, status) {
return `




Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered

This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Calling a function inside reduce / jQuery


Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription