Namespaces in JavaScript

kudvenkat
Youtube
Related Topic
:- Web Development Javascript

In this video, we will discuss how to use namespaces to avoid polluting the global scope. This is continuation to Part 55. Please watch Part 55 of JavaScript tutorial to understand the problem of global namespace pollution. JavaScript lack namespaces. However we can use objects to create namespaces. The following line says use the PragimTech object if it already exists, otherwise create an empty object. var PragimTech = PragimTech || {}; The following line adds a nested namespace.

Comments