JSFiddle - React, Tailwind, and code Playground
JavaScript
let x = 2;
let y = 8;
const a = function(b) {
return function(c) {
return x + y + Math.abs(b) + c;
}
};
y = 4;
const fn = a(x);
x = 4;
for (var i = 0; i < 100; i += 1) {
console.log(fn(Math.random() * 10));
}