I came across a JS file which was built in a strange manner:
var modal = (function(){
var method = {};
// Center the modal in the viewport
method.center = function () {};
// Open the modal
method.open = function (settings) {};
// Close the modal
method.close = function () {};
return method;
}());
I understand the part of wrapping a function into the "modal" object, but why bind all the functions to method and then return it at the end?
methods...