console.help
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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