identity
Returns the value passed to it
46 bytes
since v12.7.0
Usage
This is useful when you need to pass a function somewhere that simply returns the value it receives, without any modification.
import * as import _
_ from 'radashi'
import _
_.function identity(): undefined (+1 overload)
A function that returns the value passed to it.
identity() // => undefinedimport _
_.function identity<1>(value: 1): 1 (+1 overload)
A function that returns the value passed to it.
identity(1) // => 1import _
_.function identity<"a">(value: "a"): "a" (+1 overload)
A function that returns the value passed to it.
identity('a') // => 'a'