Let's say I have: script1.js
class A{
constructor(){
this.name = A
}
}
script2.js
class B {
constructor(){
this.name = B
}
}
then I have clients.js
const clientA = require('./script1');
const clientB = require('./script2');
module.exports = {
clientA : clientA,
clientB : clientB
}
And finally index.js
const clients = require('./clients/Clients.js');
const clientA = new clients.clientA();
But I get the error:
TypeError: clients.clientA is not a constructor
I'm kinda new in javascript, do you have any idea what I'm doing wrong here please?
AandB?