Logs the name of a function.
console.debug()
and the name
property of the passed function to log the function's name to the debug
channel of the console.fn
.const functionName = fn => (console.debug(fn.name), fn);
let m = functionName(Math.max)(5, 6);
// max (logged in debug channel of console)
// m = 6
JavaScript, Function
Creates a function that gets the argument at index n
.
JavaScript, Function
Returns a function that takes one argument and runs a callback if it's truthy or returns it if falsy.
JavaScript, Function
Returns a function that is the logical complement of the given function, fn
.