Created
April 13, 2015 18:51
-
-
Save raySavignone/d275071d9440734c65be to your computer and use it in GitHub Desktop.
debugging exercises
This file contains 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
// Why is this broken? | |
// Has the second variable assignment mispelling the variable name. | |
var mySuperAwesomeVariableName = "Ted Mosby"; | |
mysuperAwesomeVariableName = "BATMAN!"; | |
console.log(mySuperAwesomeVariableName); | |
// What's missing? How does JS interpret empty line endings? | |
// The html is missing the line breaks. | |
var bad = '<ul id="myId"> | |
<li>some text</li> | |
<li>more text</li> | |
</ul>'; | |
// Why does this fail? | |
// the single equality symbol is an assignment , the proper one would be the ===. | |
var a = 0; | |
if (a = 1) { | |
console.log("I Shouldn't be in here!"); | |
} else { | |
console.log("I Should be in here!"); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment