Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2024 07:56 AM
Hi @Snow Tomcal
when using iterative array methods (e.g., forEach, map, filter), the this value inside the callback is usually undefined.
https://www.w3schools.com/js/js_this.asp
can you try this instead.
assign the function definition to a variable outside the forEach loop and pass it as the second parameter to the forEach
var myFunc = this.myFunction
groups.forEach(function(group){
allUsers = arrayUtil.concat(allUsers, myFunc(tableName, 'group' = group, variable));
},myFunc);
Regards,
Chaitanya