

The Secret Life of JavaScript Primitives - toffeescript
http://javascriptweblog.wordpress.com/2010/09/27/the-secret-life-of-javascript-primitives/

======
LeafStorm
This...is incredibly typical of JavaScript's design.

~~~
TrevorBurnham
True. I'd argue that it's the best of both worlds: Unlike Java, you have
access to a bunch of helpful functions on every primitive, and you can add
more by modifying prototypes; and unlike Ruby, primitives are immutable, which
puts a cap on the level of complexity (you could write a whole book on Ruby's
string objects).

~~~
LeafStorm
You could do something similar by having each primitive type share a global
prototype á la Lua's "string" metatable. Most operations are implemented as
primitives in the VM, but any non-primitive operations on primitive types go
to the type's metatable.

