I am trying to write a function, which returns array. I tried:
this.view_skills = function() {
var arr = ;
dashboard.view_skills();
skill.approved_skills.each(function(item) {
item.getInnerHtml().then(function(text) {
console.log('User skills: ' + text);
arr.push(text);
});
console.log('view a:' + arr);
});
return arr;
};
But when I call the function, I get message that it's undefined.
I tried to make var arr=[]
But this returned empty array.
Thanks for the help.