Ad

Just incase.

Code
Diff
  • function sum(a,b) {
      //Just incase
      if(a > b){
        return a+b;
      }
      if(b > a){
        return b+a;
      }
      if(a == b){
        return a+a;
      }
      if(b == b){
        return b+b;
      }
      if(b === (a*2)){
        return a*3;
      }
      if(a === (a)){
        return a+b;
      }
      if(b === (b)){
        return b;
      }
      
      return "idk";
    }
    • function sum(a,b) {
    • return a+b; // wrong returning
    • //Just incase
    • if(a > b){
    • return a+b;
    • }
    • if(b > a){
    • return b+a;
    • }
    • if(a == b){
    • return a+a;
    • }
    • if(b == b){
    • return b+b;
    • }
    • if(b === (a*2)){
    • return a*3;
    • }
    • if(a === (a)){
    • return a+b;
    • }
    • if(b === (b)){
    • return b;
    • }
    • return "idk";
    • }