I can now use calss from es6, but please tell me how to use it after writing a class in another file like c#.
(Environment is running on command prompt with node.js)
Please refer to the link in the comment below and it worked.
Class Editor File
module.exports=class Cat{
// the middle of a class
}
User side files
const Cat=require(./filename);
let cat = new Cat;
For ES6, the class definition is as follows:
export default class Cat{
}
I think this is fine for the user.
import Cat from 'Cat';
When you do the above, you will need to transfer it to the babel.I added m(__)m
© 2024 OneMinuteCode. All rights reserved.