I would like to use global varibales whenever possible
For example I have a global js called global.js where I define a global util class
var glbalUtils = {
strint: {
capitalize: capitalize,
format: format // similar to python format
},
number: {
ordinate: ordinate
}
}
function capitalize(str){
// implement capitalize. All functions have definitions
}
I want globalUtils to be available throughout in code base.
These are things I feel are should be available anyway. The only other option is to extend prototype, which I have read is for suckers.
So what exactly is wrong with method of coding?