Skip to content

Instantly share code, notes, and snippets.

@raySavignone
Created April 13, 2015 18:51
Show Gist options
  • Save raySavignone/d275071d9440734c65be to your computer and use it in GitHub Desktop.
Save raySavignone/d275071d9440734c65be to your computer and use it in GitHub Desktop.
debugging exercises
// 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