> The point I wanted to make is 'this' without 'new' will refer to the object
> the function is defined on be it 'window' or whatever object.
>
That is incorrect. "this" is the actual number, not window. new or not.
Behavior is probably different for other types. ;)
Number.prototype.addFive = function() { return this + 5 };
var x = 1;
x.addFive(); => 6
var x = new Number(3)
x.addFive(); => 8
Anyways, we agree that JS is full of WTF. Let's enjoy our sweet sweet CLJS
world. :)
Cheers,
/thomas
--
Note that posts from new members are moderated - please be patient with your
first post.
---
You received this message because you are subscribed to the Google Groups
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.