Answer by daddygames for Include a class in another class
class2.jsclass Class2 { constructor(){} doSomething() { return new Promise((resolve, reject) => { resolve(`I did something too!`); }); }}exports.Class2 = Class2;class1.jsconst Class2 =...
View ArticleAnswer by r7r for Include a class in another class
You will need to export the other 2 JS classes with module.exports, and whichever file needs (main.js I believe) needs to import them using require and proper file path.//class1.jsfunction class1() {...
View ArticleInclude a class in another class
I have a main.js file and 2 classes files (.js of course). I'll use nodejs.Here is what i need to achieve:main.js class 1.js class 2.js-------- --------- ---------callin class 1 doing somethin do...
View Article
More Pages to Explore .....