Every time I assign a string, I'd actually like to assign a string object, without the extra code.
This var foo = "bar";
becomes var foo = new String("bar");
Basically hi-jacking the assignment.
Follow-up:
If the above is not possible is there a way to prototype thestring
variable type, rather than the String object?
As pointed out by armando, the foo
would be a string type, but is essentially a customized array. It would be nice to be able to prototype functions to that class.
Prototype
orJQuery
). IfRuby
could be run as part of a client-side web application, I would look more into it, but my focus is still on ECMAScript. Server-side, I'm still aPerl
devotee. :) – BendString.prototype
functions as a String object."zomgwtf".toUpperCase()
works fine. – ConvolvulaceousString object
mode? Additionally, could you use a closure method to mimic a property value? – Bend