I'm currently working on developing a custom plugin, but I've hit a roadblock at the initial stage. My goal is to create an object that can accept a parameter as its default and also include other functions within it. Below is an example of what I'm aiming for:
var a = function(str) { console.info(str); }
a = {
Test: function() { console.info(TestMessage()); },
TestMessage: function() { return "Test Message"; }
}
In essence, I need a parent object that can be called with a parameter like this: a("test"). Additionally, I want to have other functions embedded in this parent object that can access each other without explicitly needing to prefix them with "a." each time when calling from within the object. For instance, a.Test() should be able to invoke a.TestMessage() seamlessly.