JSFiddle - React, Tailwind, and code Playground
JavaScript
function flip (fn) {
return function flipped (a, b) {
return fn.call(this, b, a);
}
}
function arrow (a, b) {
return "" + a + " -> " + b;
}
console.log(flip(arrow)('x', 'y'))
function flip (fn) {
return function flipped (a, b) {
return fn.call(this, b, a);
}
}
function arrow (a, b) {
return "" + a + " -> " + b;
}
console.log(flip(arrow)('x', 'y'))