Skip to content

Instantly share code, notes, and snippets.

@frivolta
Last active October 11, 2021 08:15
Show Gist options
  • Save frivolta/15a01aee95428970a5af168ed17a501e to your computer and use it in GitHub Desktop.
Save frivolta/15a01aee95428970a5af168ed17a501e to your computer and use it in GitHub Desktop.
const addPrefix = (price) => "$" + String(price); //$ 40.00
const discountWithPrefix = compose(
addPrefix,
normalizePrice,
divide100,
multiply20
);
discountWithPrefix(200.0); // '$40.00'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment