After the Array, subclassed String
As I wrote months ago in this documentation about JavaScript prototypal inheritance , subclass native data type is not that simple (almost not possible at all) but since JS is loads of weird bits and bops, I often try to break its documented limits. It was the Array , some time ago, now it is about time for String. The concept is similar, if you subclass a native data type its methods will return that native data type like instance, so concat, charAt, toString, etc etc, will return a String unless we do not override every inherited method (so performances wont be that good). Subclassed String (function(Function, slice, push){ // from WebReflection: Subclassed String function String(String){ if(arguments.length) // clever constructor, accepts more than a string as argument push.apply(this, slice.call(arguments).join("").split("")); }; String.prototype = new Function; try{ (new String) + ""; // exception in FireFox var join = Array.proto...