Assume I do this in javascript
delete window.alert;
// returns true
then the output of console.log(window.alert); will be \"
How do you 'undelete' window.alert?
You would have needed to save a reference of the function:
var windowAlertBackup = window.alert;
And then:
window.alert = windowAlertBackup;
What is actually happening?
Any native window function is actually implemented by the javascript interpreter. In javascript window.alert is a pointer to that native function. window.alert is the only default reference to the native window.alert code.