Ternary operator

This simple demo shows the ternary operator in conjunction wtih strict and normal equalty/inquality operators

JavaScript

var a = "123",
    b = 123,
    result = "";

a == b ? result = true : result = false;
if(result){
	alert (a + result + b);
}
else{
alert('false');
}

/* Try this using the equality operator (==):
1. Set the value of a to "123" (quotes) and the value of b to 123 (no quotes).
2. Set the value of a to true (no quotes) and the value of b to 1 (no quotes)
3. Set the value of a to true (no quote) and the value of b to 0 (no quotes)
4. Repeat the above using the strict equality operator (===), inequality operator (!=), and strict inequality operator (!==)
*/