Just seen a factory style object creating in JavaScript (without literals). What else do I need to k
Posted
by alex
on Stack Overflow
See other posts from Stack Overflow
or by alex
Published on 2010-05-30T09:39:12Z
Indexed on
2010/05/30
9:42 UTC
Read the original article
Hit count: 154
JavaScript
|syntax
I have just seen this in code
var thisYear = (new Date()).getFullYear();
This is cool, as I've always done something like that in 2 lines, i.e. create the new object instance and assigned it to a variable, then called the method on it.
Is this new method fine to use everywhere? Any gotchas?
© Stack Overflow or respective owner