Some points: you write new

Some points: you write new Array, then only use named properties. That’s not an array at all, it’s just a hashmap. If you really had to write it the way you did, the appropriate incantation would be new Object. But I’d write it in a simpler way instead:

var limits = {
    safari:   defaultLimit;
    opera:    defaultLimit;
    firefox:  defaultLimit;
    netscape: defaultLimit;
    msie:     defaultLimit;
};

As for your actual point (“copy-paste coding sucks”): right on. To put it in Mark-Jason Dominus’ immortal words:

#11911 You wrote the same thing twice here. The cardinal rule of programming is that you never ever write the same thing twice.

Reply

The content of this field is kept private and will not be shown publicly.