logo

rc

The rc functions stands for return custom. It takes a function and a value and returns the value.

import { rc } from '@aracna/core';

function add(a, b) {
  return a + b;
}

// will log 0
console.log(rc(() => add(1, 2), 0));