Creates a function which returns the value given
Example:
import { of } from "@thalesrc/js-utils/function"; const base = [1, 2, 5, {}, "x", "y"]; const mapTo = of("thales rocks"); const mapped = base.map(mapTo); // ["thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks"]
Function Static Example:
import "@thalesrc/js-utils/function/static/of"; const base = [1, 2, 5, {}, "x", "y"]; const mapTo = Function.of("thales rocks"); const mapped = base.map(mapTo); // ["thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks"]
The value which created function returns
A function which returns the returnValue
returnValue
Generated using TypeDoc
Function Of
Creates a function which returns the value given
Example:
import { of } from "@thalesrc/js-utils/function"; const base = [1, 2, 5, {}, "x", "y"]; const mapTo = of("thales rocks"); const mapped = base.map(mapTo); // ["thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks"]
Function Static Example:
import "@thalesrc/js-utils/function/static/of"; const base = [1, 2, 5, {}, "x", "y"]; const mapTo = Function.of("thales rocks"); const mapped = base.map(mapTo); // ["thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks", "thales rocks"]