I’m the invisible man .

Montez: Gershkovich, it’s a page flip thing and the hidden page gets preloaded

Strogen: Usman: yea i know but problem is long and complex

Gershkovich: Anotheryou: that’s completely different from how you described it initially

Zilk: But now i have 2 scenarios: preload the hidden div or load for all divs

Nasalroad: It’s like my clients, the more they talk, the more their needs change

Usman: Twirl: right, but if you ask about X when you really want to know about Y, our answer may change

Covarruvia: But yes, I might best write 2 functions that share a lot of fuctions inside

Usman: Answers don’t exist in a vaccuum, they have context

Usman: What works for X may not be correct for Y

Usman: Doesn’t change what I’m saying

Nasalroad: Function answerwhat { switchwhat { case ‘X’: case ‘Y’: work; break; } }

Deasis: I was wondering : Is this function foo{return true;} possible?

Nasalroad: Function foo{return true;}

Wakley: Nasalroad: SyntaxError: syntax error

Deasis: Nasalroad: Nice, Thank you :

Teaster: Deasis: as long as it occurs in an expression

Nasalroad: Function foo{return true;}

Wakley: Nasalroad: boolean true

Deasis: Dekok: In an expression? In which case wouldn’t it work?

Usman: When it’s not in an expression.

Usman: Like in the case Nasalroad made above before wrapping in parens

Nasalroad: My examples are totally invisibles

Wicklund: Function foo{ } // this is a statement. Statements do not return values. Therefore you can’t interact with statements

Wakley: Dekok: SyntaxError: syntax error

Usman: Wrapping in parens makes it an expression

Gagney: Function foo{ } // this is an expression. Expressions return values. Therefore you can interact with expressions

Nasalroad: When I write, I wrap my text in visibility:hidden

Deasis: Dekok: So the function is called But I can’t store the result? Is that what you mean?

Usman: Deasis: no, when you do function foo{}, it doesn’t return a function

Miller: Deasis: there’s no function call in a statement. Statements have no values. At all.

Usman: So you can’t call the returned value

Coody: Deasis: statements only exist to modify the world

Usman: All it does is stuff a function into foo, without returning anything to work with

Zesati: Just like you can’t do var x = return 1, because return is a statement, not an expression

Pexsa: Which is preferred? function foo{} or function foo{}?

Usman: Deasis: give this a read: http://www.2ality.com/2012/09/expressions-vs-statements.html

Kiper: You can’t do return 1 either

Greigo: Pexsa: they’re the same thing

Deasis: But if I do function foo{/*some code*/}, does it call the function?

Wende: Deasis: only if it’s in an expression

Usman: No, it’s a syntax error

Usman: As Nasalroad demonstrated above

Usman: Deasis: give this a read: http://www.2ality.com/2012/09/expressions-vs-statements.html

Pexsa: Dekok, This is the first time I’ve seen the first form.

Usman: Pexsa: there’s also +function{}

Pexsa: The second form seems clearer to me.

Wakley: Nasalroad: boolean true

Usman: Then go with the second Pexsa since they are functionally equivalent

Deasis: Usman: Dekok Ok, I’ll check this out. Thank you both! :

Usman: Go with whatever makes more sense to you

Usman: Nasalroad: you get nothing!

Nasalroad: I’m the invisible man !