0 votes
in JavaScript by
What is a unary function in Javascript?

1 Answer

0 votes
by

Unary function (i.e. monadic) is a function that accepts exactly one argument. It stands for a single argument accepted by a function.

Let us take an example of unary function,

const unaryFunction = (a) => console.log(a + 10); // Add 10 to the given argument and display the value
...