Created
March 28, 2012 17:41
-
-
Save kirbysayshi/2228570 to your computer and use it in GitHub Desktop.
+= kills things
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
var out = ''; | |
function doWhat(){ | |
out += '<li>'; | |
console.log(out === '<li>'); // at this point, out will equal '<li>' | |
return ''; | |
} | |
out += doWhat(); | |
console.log(out, out === '<li>'); | |
// I expect out to == '<li>', but it's actually an empty string!? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment