This is my code
const calculator = (req, res) => {
let option = req.body.option
let num1 = req.body.num1
let num2 = req.body.num2
//console.log(num1 + num2)
if (option == '+') {
res.status(200).send({
success: true,
result: num1 + num2
})
}
}
module.exports = { calculator }
I am trying to add num1 and num2, for eg num1 = 2 and num2 = 2 expected result should be 'result: 4'
but instead of result: 4 I am getting result: 22