how do I generate something like:
function generator() {
static funct(){}
}
I think I'm wrong, but from what I understand the class {}
method is built on top of function(){}
, so it should have the same method. The point is that static methods don't have a .prototype
, and I'd like to know how they're created via class {}
@UPDATE
apparently from what I understand the class {}
method actually builds static functions through Object()
, since both can create static functions.
class A {
static a() {}
}
const B = {b(){}};
console.log('a' in A && 'b' in B)
console.log(`${A.a.prototype}, ${B.b.prototype}`);