A simple function to extend native object
void extendNative(Function constructor, optional String property, Object methods);
In order to prevent collisions with future standard all extensions are added under a specific property ($
by default), this is configurable by the optional second argument:
extendNative(String, {
someExtension: function() { }
});
'my string'.$.someExtension();