Created
May 14, 2012 20:41
-
-
Save thesven/2696699 to your computer and use it in GitHub Desktop.
Quick check....
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> Assignment Check Test</title> | |
</head> | |
<body> | |
<div id="myValue"> | |
</div> | |
<script> | |
var valueOne = null, valueTwo = "hello"; | |
var finalValue = valueOne || valueTwo; | |
var finalValueTwo = (valueOne != null) ? valueOne : valueTwo; | |
if(console){ | |
console.log(valueOne); | |
console.log(valueTwo); | |
console.log(finalValue); | |
console.log(finalValueTwo); | |
} | |
document.querySelector('#myValue').innerHTML = finalValue; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment