JSFiddle - React, Tailwind, and code Playground

by Reginald Braithwaite

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'))