public
Last active

+= kills things

  • Download Gist
bizarre.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11
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!?

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.