Tech Off Post

Single Post Permalink

View Thread: is 'new object().property' or 'new object().method()' a good idea?
  • User profile image

    shuff1203 wrote:
    My quesiton was is there an equivalent to:

    New Application().run(f)

    I realize I could declare a var and use it.

    Try declaring a function and passing that as the arguments:

    foo( New Application().run(f) )

    If that throws an error, then no you can't, otherwise you might need to declare the type of the variable you're assigning first.