30 seconds of code

  Back to Home

unary

adapterfunctionintermediate

Creates a function that accepts up to one argument, ignoring any additional arguments.

Call the provided function, fn, with just the first argument given.

const unary = fn => val => fn(val);