I have this code in my lightning component helper where I want to call another method form the same helper.
window.setTimeout(
$A.getCallback(function() {
for(var key in someFieldsets){
if(someFieldsets[key].fieldAPIName == 'sampleField__c' && !$A.util.isEmpty(someFieldsets[key].fieldValue)) {
this.secondFunction(component);
}
}
}), 2000
);
calling this.secondFunction(component);
works when it is outside the setTimeout but when inside it, it doesn't perform the secondFunction anymore. what is the other option of calling a function within the helper? why does 'this' doesn't work this time?