Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function carpet(pricePerSqrMetre, roundUp) {
function priceForRoom(area) {
let sqrMetres = area;
if (roundUp) {
sqrMetres = Math.ceil(sqrMetres);
}
return sqrMetres * pricePerSqrMetre;
}
return priceForRoom;
}
module.exports = carpet;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment