Home >Web Front-end >JS Tutorial >Manage the use of namespaces to avoid conflicts in js and avoid the proliferation of global variables_javascript skills
In order to avoid overwriting and conflicts between variables, a namespace can be generated. The namespace is a special prefix, which is implemented through the { } object in js.
In different anonymous functions, declare a different namespace according to the function. The attributes of the GLOBAL object in each anonymous function are not directly hung on GLOBAL, but are hung under the namespace of the sub-anonymous function. , such as: