Just to relate this to known concepts, this is basically Type Coercion, aka Implicit Type Conversion, at library level. Or it can be framed as method overloading with some magic to neutralize the parameters.<p><a href="http://en.wikipedia.org/wiki/Type_conversion#Implicit_type_conversion" rel="nofollow">http://en.wikipedia.org/wiki/Type_conversion#Implicit_type_c...</a><p>I don't think magic like this is out of place with JS; that's the zen of the language. Similarly for Ruby. Whereas in Java or Python, it <i>would</i> be out of place. Now you might use that as an argument against JS, but that's a separate debate.