In the file data.js i have:
(function () {
data()
function runThisWhenDataIsFinished() {
console.log("Works!");
}
})();
In the file app.js i have
function data() {
console.log("Im in the data function");
runThisWhenDataIsFinished();
}
When i call on data() i get the message "Im in the data function", when i try to call on the runThisWhenDataIsFinished() method i get error: runThisWhenDataIsFinished() method is not defined.
So how can i access runThisWhenDataIsFinished method in data.js from app.js?
Best regards