For example:
var resultList = [];
var objectName = (userName) => {
};
objectName.rowCount;
// return overall count
objectName.fetchNext();
// updated data will be available in resultList
I have tried multiple solutions with no result like
var resultList = [];
var objectName = (userName) => {
var rowCount = 0;
init() {
// make call to server and read data
rowCount = 5; // setting dummy data
};
fetchNext = function(){
// logic here
resultList = [] // new data
};
init();
};
EDIT
Another attempt
var x = function(){
var a = function(){console.log('a');};
var b = function(){console.log('b');};
return {a: a, b: b};
}
x.a(); // not able to call this function