I was trying to modularise the JS code but stuck at a point for quite a long time, I know the solution will be easy but just can't figure it out. Here is the fiddle link: Fiddle.
Adding code here as well.
window.a = (function () {
function abc() {
alert("Hi");
}
return {
abc: abc
}
});
window.b = (function (aWindow) {
function i() {
aWindow.abc();
}
return {
i: i
}
})(window.a);
<a href="#" class="abc" onClick="window.b.i()">Click Me</a>
Error
"<a class='gotoLine' href='#60:10'>60:10</a> Uncaught TypeError: aWindow.abc is not a function"
()for the firstIIFE- i.e. otherwise it's NOT an IIFE and window.a is just that function as you've written it - either that or do})(window.a())