Mahesh Subramaniya

engineer, developer, photographer, coffee lover
@msubramaniya |

IE Heisenbug

Circa 2009, when I was testing the mobile webapp in cross platform, Internet Explorer is especially a pain in the neck. One such pain is a Heisenbug that I came across.

console.log('heisenbug');
alert('if you see this, then no heisenbug');

Fiddle here

This bug was so irritating that I couldnt figure out easily why this code is breaking. And screw the IE developer tool.

Easy fix? Just redefine the console object to use alert, as 1st line of the code.

console.log = function(o){ alert(o); }

Tagged under: javascript, bug,