I am trying to call a function within a function. Here is the code
var d = function() {
s: function() {
alert('cool');
}
} ();
d.s();
This does not work. What am I doing wrong
Here is another approach using the so-called module pattern:
var d = function() {
return {
s: function() {
alert('cool');
}
};
}();
d.s(); // invokes the function s