Hi I am new to javascript and I am trying to maintain someones code, but I cant seem to figure out what they are doing.
They seem to be declaring a function like so:
(function(Module) {
Module.register(...) {
....
return ...;
};
Module.register(...) {
....
return ...;
};
}(hb.Core));
If you wanted to create a function that called Module.register twice (which is what I think they are trying to do), wouldn't you do the following?
function myFunction(Module) {
Module.register(...) {
...
};
Module.register(...) {
...
};
}
myfunction(Module);
Also, don't know if this is really relevant, but they are using the sandbox model (where they have different modules communicate with the application core only through a sandbox).
Hope someone can help out. I am really new to Javascript and front-end development in general and I am very confused.