`let areaCircle = (radius) => {
return Math.PI * radius * radius
}
let areaRect = (length, width) =>{
return (length * width)
}
exports.areaCircle = areaCircle
exports.areaRect = areaRect
`
`let areaCircle = (radius) => {
return Math.PI * radius * radius
}
let areaRect = (length, width) =>{
return (length * width)
}
exports.areaCircle = areaCircle
exports.areaRect = areaRect
`
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
actually i am pretty sure I have resolved it like so
`let areaCircle = (radius, done) => {
process.nextTick(() => {
let result = Math.PI * radius * radius;
done(null, result)
});
}
let areaRect = (length, width, done) =>{
process.nextTick(()=>{
let result = length * width
done(null, result)
});
}
module.exports = geometry;
`
and then calling them I would have to add the error handling ?
`const geometry = require("./modules/bModule.js");
geometry.areaCircle(3, (err, results) => {
if (err) {
throw err;
}
console.log(results.toFixed(2));
});
geometry.areaRect(4, 6, (err, results) => {
if (err) {
throw err;
}
console.log(results);
});`