From ccf0c6735a1b967c9ada0b71828d9ad9af69eac3 Mon Sep 17 00:00:00 2001 From: Peter Szekeli Date: Wed, 30 Oct 2024 17:24:38 +0000 Subject: [PATCH] feat: add power operation to calculator --- api/controller.js | 1 + 1 file changed, 1 insertion(+) diff --git a/api/controller.js b/api/controller.js index 949731c..136620f 100644 --- a/api/controller.js +++ b/api/controller.js @@ -16,6 +16,7 @@ exports.calculate = function(req, res) { 'subtract': function(a, b) { return a - b }, 'multiply': function(a, b) { return a * b }, 'divide': function(a, b) { return a / b }, + 'power': function(a, b) { return Math.pow(a, b) } }; if (!req.query.operation) {