How to manage many global variables and methods in Jquery project

is it defined as multivariable in data like vue?
can I define an app object and add many key-value pairs to it?
how do you usually manage? ask for advice humbly

Apr.01,2021
Try not to use global variables in

jquery, which may cause global pollution


the most basic thing is to define an object for unified management, as the landlord said, there is nothing wrong with the idea of the landlord, and he is confident.


it is recommended to deal with it by module / page

var app = {
    user:{} // //
    admin:{}// //
};
Menu