src/Rectangle.js
function Rectangle (length = 0, width = 0) {
this.length = length
this.width = width
}
Rectangle.prototype.getArea = function () {
return this.length * this.width
}
module.exports = Rectangle
app.js
const Rectangle = require('./src/Rectangle')
const rectangle1 = new Rectangle(6, 7)
const rectangle2 = new Rectangle(3, 4)
console.log('Area: ' + rectangle1.getArea())
console.log('Area: ' + rectangle2.getArea())