Why doesn't jQuery consolidate its constants?

All my constants are at the top of my javascript file, as shown below.

When I look at the main jQuery file, nothing happens for a constant, and I don’t see that they pull out the constants? They don’t have them, they distribute them through code, if so, why don’t they combine them?

I'm not interested in the language construct const, but the concept of pulling your constants in one place, as shown below.

var Constant = 
{
    VALIDATE_ON:                    1,
    JSON_ON:                        0,
    ROOT:                           '',
    PICTURES:                       '../pictures/',
    TEXT:                           '../text/',
    FAVICON:                        '../images/logo_small.ico',
    IMAGES:                         '../images/',
    GATEWAY:                        'class.ControlEntry.php',
    ENTER_KEY:                      13,
    SECOND:                         1000,
    MINUTE:                         60,
    HOUR:                           3600,
    DAY:                            43200,
    AML: 
    {
        "PASS":                     0,
        "FAIL":                     1, 
        "NOTDEFINED":               2
    }
};
+5
source share
2 answers

jQuery, , . , . jQuery. , , .

, , , .

+4

. jQuery jQuery, "" , .

.

, ( ). , - , .

, , . , .

var Paths = {
    ROOT:       '',
    PICTURES:   '../pictures/',
    TEXT:       '../text/',
    FAVICON:    '../images/logo_small.ico',
    IMAGES:     '../images/',
    GATEWAY:    'class.ControlEntry.php'
};

var TimeCounts = {
    SECOND:    1000,
    MINUTE:    60,
    HOUR:      3600,
    DAY:        43200
};

var KeyCodes = {
    ENTER_KEY: 13
};

, , (, , , ).

+1

All Articles