Both Effect.Highlight(...)
and new Effect.Highlight(...)
work just fine.
So whats the difference in both usages, if any.
I started wondering about this because resharper (6) is showing me a warning when I use new Effect.Highlight(...)
: Expression statement is not assignment or call.
Manu.
Looks like the Highlight()
function is static, so you can call it either way, but the simplest one will always work:
Effect.Highlight(...)
Whereas instantiating a new
object might not (if the class isn't supposed to be instantiated)
However, Javascript is generally soft on those kinds of function calls, so I'm guessing you could also use:
(new Effect).Highlight(...)
as long as you enclose the instantiation in parenthesis so the interpreter will know what you're trying to do