Nested if-statement
5 posts • Page 1 of 1
Nested if-statement
In the console I want to define a function with a nested if-statement but I noticed: it doesn't work
I typed it in like this:
scene.my.var = (x) => { if ? { if ? {then} : {else} } : {else} }
But I get an error because the console hates me. Any ideas how to get it to work?
I typed it in like this:
scene.my.var = (x) => { if ? { if ? {then} : {else} } : {else} }
But I get an error because the console hates me. Any ideas how to get it to work?
-
KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: Nested if-statement
You have to do it this way:
Scene.my.var = (x) =>{if ? {true} : {if ? {true} : {false}}}
Do you get it?
Scene.my.var = (x) =>{if ? {true} : {if ? {true} : {false}}}
Do you get it?
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Nested if-statement
aaaalright thanks yeah i think i got it
-
KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: Nested if-statement
Great! If you have anymore questions on things like this I can help.
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Nested if-statement
thanks
-
KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
5 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests