Skip to content

Instantly share code, notes, and snippets.

@v0lkan
Forked from anonymous/console.extend.wtf.js
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save v0lkan/520198942f69f6f99442 to your computer and use it in GitHub Desktop.
Save v0lkan/520198942f69f6f99442 to your computer and use it in GitHub Desktop.
A shim for the console.wtf functionality (hoping that somebody natively implements that feature in the future ;))
// ## Every console needs a WTF prompt.
//
// Usage:
//console.wtf('This should not have happened AT ALL!', param1, param2);
// Check if `console.wtf` is natively supported.
if (!console.wtf) {
console.wtf = function() {
console.warn.apply(console,
['(W)hat a (T)errible (F)ailure »» '].concat(
Array.prototoype.slice.call(arguments)
)
);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment