Traditional way:
const shape = function (sahpe) {
return function (color) {
return console.log(`${color} ${sahpe}`);
};
};
const circle = shape("circle");
circle("red"); // red circle
circle("blue"); // blue circle
shape("square")("wite"); //wite squareArrow function:
const shapeArrow = (sahpe) => (color) => console.log(`${color} ${sahpe}`);
shapeArrow("triangle")("orange"); //orange triangle