Skip to content

Commit

Permalink
feat: add power operation to calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
peterszekeli committed Oct 30, 2024
1 parent 2d0ff47 commit ccf0c67
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ccf0c67

Please sign in to comment.