Quotes help make search much faster. Example: "Practice Makes Perfect"

Monday, December 3, 2012

Codecademy: Codeyear Ternary Operator


//sample solution


var x = 2;
var y = 1;

//The ternary operator in action
//result = x > y ? "good job" : 20;

//Rewrite the ternary code using if else statements
if(x>y){
result = "good job";
} else {
result = 20;
}

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts