zelot
8 years agoNew Contributor
javascript inheritance
hello, I have a problem with inheritance using javascript. I have the following code: file: MyFirst
class A{
constructor(x){
this.x = x;
}
static getA(){
return this.x;
}
}
file...
- 8 years ago
I was trying to answer a JavaScript question but accidentally committed sin. I apologize :(
For OP: Below is how I'd export and require.
//file 1 class Foo { } module.exports = Foo //file 2 const Foo = require('file1') class Bar extends Foo { }