Methods

 const calc = {

  add(a, b) {
    return a + b;
  },
  sub(a, b) {
    return a - b;
  },
  mul(a, b) {
    return a * b;
  },
};
console.log(calc.add(3, 5));
console.log(calc.mul(17, 5));
console.log(calc.sub(71, 35));


Comments

Popular posts from this blog

Callback Hell

TODO list with DOM

Refactoring callback hell code