bastiano bastiano over 2 years ago

is used to make decisions in JavaScript.
if (condition){ statements }
The condition in the parenthesis ( ) is evaluated to determine if true, and if so then the statements inside the curly braces { } are executed,
An optional else statement can be included with if statement
if (condition){ statements } else{ statements }
the statements inside of curly brackets { } after the else keyword are executed if the condition of if statement is false.
nest if statements
A better way
&&
The and operator
to combine two conditions
both must be true to satisfy the if condition.
he or operator, ||,
combines two conditions
such that the if statement is satisfied if either condition is true.
Not
Operator, !,
makes a condition that returns true, false and vice versa.
- Annotations on Learn Java Script: if Statement

Share this annotation

Post to Basecamp Project Update Twitter Bookmark on Del.icio.us Send E-mail Post to a Blog Post to Backpack Post to Trac Post to Bugzilla Post to a Tumblr Update Friendfeed Posterous

paste in your blog
 
paste anywhere: IM, mail
 
give this link to a friend
 

Tags: jul_09, lectures-javascript.blogspot.com, annotations
Comments are allowed
This copy is published

Note: "This copy is kept-secret" would mean its URL is not published, but anyone knowing its URL can still view it.