The code below does not seem to be able to concatenate a JSON result into a string, does anyone have any idea why?
function wordCloud(filename)
{
var file = filename;
var text = " ";
$.getJSON(file, function(data) {
$.each(data, function(key, val) {
text = text.concat(val.toString());
});
});
console.log(text);
}
Thanks