What do you understand by namespacing in JavaScript?

It is usually not a good practice to use global variables in programming languages including JavaScript. However, sometimes we may have to use global variables. So, JavaScript introduces the concept of namespacing which ties down a part of the code and registers it with a unique name.
The namespace is nothing more than a container name where we hold classes, functions, and variables that can be repeated with the same name in other namespaces or namespace without involving an error.