JavaScript in browser
Well, at least in IE11.
window.addEventListener("error", function(){});
document = document.write = alert = prompt = confirm = console = void(
(function (window) {
try {
//Code goes here
} catch (e) {}
})({})
);
Disables writing to the document, writing to the global variable and returning from the function.
Comment if I've missed out an output method!