JavaScript: Compute the sum of the two given integers

 let x = 5;

let y = 6;


function sun(x,y) {

  if (x == y) {

    return 3 * (x + y);

  } 

  else {

    return x + y;

  }

}

console.log(sun(5, 12));

console.log(sun(5, 6));

Comments

Popular posts from this blog

practice test of Arithmetic Operations: