Simple: I want to disable/overwrite alert().
alert()
Can I do this?
More importantly, is it right to do this?
What about strict mode?
Yes you can, it's your choice. You could also store the original 'alert':
window.nativeAlert = window.alert; window.alert = function(val){console.log(val+' (alert disabled)');};
now the old alert is still usable: nativeAlert('something');
nativeAlert('something');