codedamn

Mini-promised calculator

Created by Codedamn about a year ago

0

No description provided

2 Comments

    0

    correct ans is not taking

    @janmejaya

    janmejaya

    @janmejaya

    0

    function calculator(num1, num2, operation) { // return a Promise function fn(resolve , reject){ if(operation == "+"){ console.log(num1+num2) resolve(num1+num2) } if(operation == "-"){ resolve(num1-num2) } else{ reject("rejected") } } return new Promise(fn) } console.log(calculator(2 , 3 , "+")) module.exports = calculator(2 , 3 , "+")

    this is my sollution but it is not getting passed

    @janmejaya

    janmejaya

    @janmejaya

Your comment