Created
June 19, 2020 09:53
-
-
Save akash-rajput/f2290806123418eb84e57b7ef8b89eb9 to your computer and use it in GitHub Desktop.
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
const sizeof = require("object-sizeof"); | |
class ABC { | |
constructor() { | |
this.data = "asdd"; | |
this.iMethod = this.iMethod.bind(); | |
} | |
iMethod() { | |
console.log("instance method called"); | |
} | |
static sMethod() { | |
console.log("static method called"); | |
} | |
} | |
console.log("typeof ABC", typeof ABC); | |
console.log("prototype ABC", ABC.prototype); | |
const obj = new ABC(); | |
console.log("class object", obj); | |
console.log("typeof Obj", typeof obj); | |
console.log("sizeof object", sizeof(obj)); | |
console.log("typeof obj.iMethod", typeof obj.iMethod); | |
console.log("typeof obj.sMethod", typeof obj.sMethod); | |
console.log("sizeof obj.sMethod", sizeof(obj.sMethod)); | |
console.log("sizeof ABC.sMethod", sizeof(ABC.sMethod)); | |
console.log("prototype of ABC.sMethod", ABC.sMethod.prototype); | |
debugger; | |
console.log("prototype of ABC.sMethod", ABC.sMethod.prototype); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment