Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 583 Bytes

nullSafe.md

File metadata and controls

18 lines (12 loc) · 583 Bytes

nullSafe (source code)

  • Curried: false
  • Failsafe status: failsafe by default

The nullSafe function takes a function as an argument and returns a curried version of the function. It ensures that the last argument passed to the curried function is not null or undefined before invoking the original function func.

Arguments

  • func: A function that needs to be curried.

Usage

const add = (a, b) => a + b;
nullSafe(add)(1)(2);
// Output: 3