Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const add = (x,y) => x + y;
const subtract = (x,y) => x - y;
const multiply = (x,y) => x * y;
const arrayOfFunctions = [add, subtract, multiply];
arrayOfFunctions.forEach(calculationFunction => console.log(calculationFunction(1,1))); // 2 0 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment