manipulation-number/level-0/index.js
/**
 * Calculator Math
 * Level 14-15
 */
Calculator Math
Level 14-15
Calculator Math Level 14 - 15
function calc(x, y, operator) {
  this.add = function() {
    return x + y;
  };
  this.substract = function() {
    return x - y;
  };
  if (operator == "add") {
    this.add();
  } else {
    this.substract();
  }
}
function calc ( x , y , operator ) { this . add = function ( ) { return x + y ; } ; this . substract = function ( ) { return x - y ; } ; if ( operator == "add" ) { this . add ( ) ; } else { this . substract ( ) ; } }
Calculator Math
 Level 14-15
Calculator Math Level 14 - 15