You are viewing our Forum Archives. To view or take place in current topics click here.
[Javascript] Need help. (CodeAcademy)
Posted:

[Javascript] Need help. (CodeAcademy)Posted:

Freighter
  • Wise One
Status: Offline
Joined: May 16, 201211Year Member
Posts: 582
Reputation Power: 25
Status: Offline
Joined: May 16, 201211Year Member
Posts: 582
Reputation Power: 25
I'm curious on what I did wrong here.

[ Register or Signin to view external links. ]




Instructions it gave me

[ Register or Signin to view external links. ]
#2. Posted:
Imp
  • Shoutbox Hero
Status: Offline
Joined: Jan 01, 201113Year Member
Posts: 1,957
Reputation Power: 401
Status: Offline
Joined: Jan 01, 201113Year Member
Posts: 1,957
Reputation Power: 401
Perhaps you should read a little more into the IF statement (Section 14/28 on Getting Started with Programming)

You will never learn anything if you are always spoon fed the answers ;)
#3. Posted:
MrMarooca
  • New Member
Status: Offline
Joined: Sep 29, 201211Year Member
Posts: 7
Reputation Power: 0
Status: Offline
Joined: Sep 29, 201211Year Member
Posts: 7
Reputation Power: 0
I agree with Imp, however I understand it can get frustrating if you can't figure out how to get your code functioning right away.

Proper syntax for comparisons (less than, greater than, etc.) are as follows.

Less than - <
Less than or equal to - <=
Greater than - >
Greater than or equal to - =>

Your if statements should go something like this:

if(age < 13) // If age is less than 13.
{
   // Do something.
}
else if(age => 13) // If age is over or equal to 13
{
   // Do something else.
}


Happy coding, friend!
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.