You have posted what looks like it's supposed to be a common “module pattern” implemented with an Immediately Invoked Function Expression (IIFE).
(function (Skd, $, undefined) {
// module body
}(Skd = Skd || {}, jQuery));
It defines function () { } and calls it immediately (Skd = Skd || {}, jQuery)
This pattern is normally used to create a private scope for the library and attach public members to a namespace (Skd) object.
The syntax Skd = Skd || {} will create a new object if there is not already a global object with the same name.
A few notes
Skd.title = "Skd"; // public
Skd.method = function() {
// public method
};
var title = "SkdInternal"; // private, not visible outside
var method = function() { // private helper
// ...
};
But your
title = "SkdInternal";
method = function() { ... };
are not “internal”. Without var/let/const this creates or overwrites global variables in sloppy mode, which you do not want.
Your #title and #method are using Class syntax and will throw errors in an IIFE
(function (Skd, $, undefined) {
function Widget(options) {
// constructor code
this.options = options || {};
}
// optional: allow calling without new
Skd.Widget = function (options) {
if (!(this instanceof Skd.Widget)) {
return new Skd.Widget(options);
}
Widget.call(this, options);
};
Skd.Widget.prototype = Object.create(Widget.prototype);
Skd.Widget.prototype.constructor = Skd.Widget;
}(Skd = Skd || {}, jQuery));
Then users can do either:
var w1 = new Skd.Widget({ ... });
or
var w2 = Skd.Widget({ ... }); // also works because of the guard
If the class members defined with # had been inside a class, then they would become real private fields
For example:
class Skd {
#title = 'SkdPrivate' // private field
title = 'SkdInternal' // public field
constructor() {
this.title = 'Skd' // public
this.#title = 'secret' // private, only visible here
}
#method() { // private method
console.log('private')
}
method() { // public method
this.#method() // allowed
}
}
const x = new Skd()
x.title // OK
x.#title // SyntaxError: private field not accessible
x.#method() // SyntaxError
This should get you on the right track and at least give you the search terms you need.