nectarjs
Version:
Javascript's God Mode. No VM. No Bytecode. No GC. Just native binaries.
32 lines (27 loc) • 456 B
JavaScript
/*
testClass proposed by @wesley1989 on Discord to test classes implementation
*/
function something(a) {
return a
}
class Test{
constructor(a){
if(a instanceof Test){
//this not working
a.map(something)
}else{
return undefined
}
}
map(execFunc) {
execFunc()
}
static map(execFunc) {
execFunc()
}
}
var t = new Test(null)
t.map(something)
Test.map(something)
var t2 = new Test(t)
console.log(t,t2);