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:{}// //
};
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea7fae-47c63.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea7fae-47c63.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?