Code Library

Namespaces in JavaScript libraries (incomplete)

One of the biggest challenges when working with JavaScript is the concept of “Global Namespace Pollution“. If two or more functions have the same name:

Because JavaScript does not have a function overloading mechanism, Function B will override Function A, assuming that the library containing Function B was loaded last.

Microsofts advice to anyone writing JavaScript is to use Namespaces or a unique prefix/postfix.

Unique Function Prefix

Namespaced library names

Usage

No additional information.

JavaScript Libraries for Microsoft Dynamics CRM((https://msdn.microsoft.com/en-us/library/bd56ab90-2179-48ad-bb4a-9539d7c770c2#BKMK_CreatingScriptLibraries))

JavaScript