Caches the result of a function call by its arguments.
const cached = cache(() => Math.random())cached() // will be called immediatelycached() // will return the same value Copy
const cached = cache(() => Math.random())cached() // will be called immediatelycached() // will return the same value
Caches the result of a function call by its arguments.