samedi 5 mars 2016

JavaScript namespacing with/whitout var

I need to know the difference between:

Namespace = (function () { 
    return { 
        name: 'Module', 
        dep: ['d', 'a']
    };
})();

and

var Namespace = (function () { 
    return { 
        name: 'Module', 
        dep: ['d', 'a']
    };
})();

simple as that but i still don't understand.

Aucun commentaire:

Enregistrer un commentaire