Skip to content

Instantly share code, notes, and snippets.

@thesven
Created May 14, 2012 20:41
Show Gist options
  • Save thesven/2696699 to your computer and use it in GitHub Desktop.
Save thesven/2696699 to your computer and use it in GitHub Desktop.
Quick check....
<!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