Saturday 28 January 2017

javascript - Adding functions to the same namespace

I have the following code in a .js file. How do I add new functions within the same namespace from a different .js file?



if ("undefined" == typeof(sample)) {
var sample = {};
}

sample = {
foo : function () {


},

bar : function () {

}
};

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...