An export module inside if class code example
Example 1: node js module export class
module.exports = class Person {
constructor(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
display() {
console.log(this.firstName + " " + this.lastName);
}
}
Example 2: export function javascript
// module "mon-module.js"
export default function cube(x) {
return x * x * x;
}