Skip to content

Instantly share code, notes, and snippets.

@PaulKinlan
Last active September 13, 2017 20:48
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 PaulKinlan/ae195a68bc1968784e3c22f7c0289a00 to your computer and use it in GitHub Desktop.
Save PaulKinlan/ae195a68bc1968784e3c22f7c0289a00 to your computer and use it in GitHub Desktop.
console.help
console.help = function(arg) {
if(arg === null || arg === undefined) return console.log(arg);
if(typeof(arg) === 'string') return console.log(arg);
if('__help' in arg) { console.log(arg.__help); }
if('__help' in arg.constructor) { console.log(arg.constructor.__help); }
console.log(arg);
}
.bind(console);
class Test {
static get __help() {
return "This is a Test";
}
constructor() {
}
sayHello(msg) {
return `Hello ${msg}`;
}
}
console.log(Test);
console.log(new Test);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment