JSFiddle - React, Tailwind, and code Playground

by chclaus

JavaScript

function makeAdder(x) {
  return function(y) {
    return x + y;
  };
}

const add5 = makeAdder(5);
let result = add5(2);

console.log(result);
console.dir(add5);