Need some help with Code Academy

• 02-19-2013, 03:41 PM
hotrod624
Need some help with Code Academy
I'm taking a course at my local college for programming, and one of the assignments is going to code academy. Which I don't like because I don't think it explains good enough for what it wants you to do. But anyways here is the description of the exercise.

"Write code that contains an if/else statement, just like we did in the last exercise. When your condition is true, print to the console "I am right". When it is false, print to the console "I am wrong". Make sure your statement evaluates to false so it prints out "I am wrong".

Ok I found the answer online because I couldn't figure it out, here it is.

if (10 > 5 * 2) {
} else {
console.log(1);
}

So my question is what does it mean when it says console.log(1); What does the (1) mean?
• 02-19-2013, 07:26 PM
lordsarito
Quote:

Originally Posted by hotrod624
I'm taking a course at my local college for programming, and one of the assignments is going to code academy. Which I don't like because I don't think it explains good enough for what it wants you to do. But anyways here is the description of the exercise.

"Write code that contains an if/else statement, just like we did in the last exercise. When your condition is true, print to the console "I am right". When it is false, print to the console "I am wrong". Make sure your statement evaluates to false so it prints out "I am wrong".

Ok I found the answer online because I couldn't figure it out, here it is.

if (10 > 5 * 2) {
} else {
console.log(1);
}

So my question is what does it mean when it says console.log(1); What does the (1) mean?

I just started using code-academy yesterday.

"if (10 > 1 * 2)
{
console.log("I am right");
}
else
{
console.log("I am wrong");
}
Is a similar answer I gave, console.log(1) doesn't need to be there.

X vBulletin 4.2.2 Debug Information

• Page Generation 0.14600 seconds
• Memory Usage 2,351KB
• Queries Executed 11 (?)
Template Usage (20):
• (1)bbcode_quote_printable
• (1)footer
• (1)gobutton
• (1)navbar_moderation
• (1)navbar_noticebit
• (2)option
• (1)spacer_close
• (1)spacer_open

Phrase Groups Available (3):
• global
• postbit
Included Files (19):
• ./global.php
• ./includes/class_bootstrap.php
• ./includes/init.php
• ./includes/class_core.php
• ./includes/config.php
• ./includes/functions.php
• ./includes/class_friendly_url.php
• ./includes/class_hook.php
• ./includes/class_bootstrap_framework.php
• ./vb/vb.php
• ./vb/phrase.php
• ./includes/functions_calendar.php
• ./includes/class_bbcode_alt.php
• ./includes/class_bbcode.php
• ./includes/functions_bigthree.php
• ./includes/functions_notice.php

Hooks Called (41):
• init_startup
• init_startup_session_setup_start
• database_pre_fetch_array
• database_post_fetch_array
• init_startup_session_setup_complete
• global_bootstrap_init_start
• global_bootstrap_init_complete
• cache_permissions
• fetch_foruminfo
• global_state_check
• global_bootstrap_complete
• global_start
• style_fetch
• global_setup_complete
• bbcode_fetch_tags
• bbcode_create
• bbcode_parse_start
• bbcode_parse_complete_precache
• bbcode_parse_complete
• cache_templates
• cache_templates_process
• template_register_var
• template_render_output
• fetch_template_start
• fetch_template_complete
• parse_templates