// package
set-function-length
type: "module"
// preferences
// replacements (1)
snippet::set-function-length
Simple or drop-in replacementThis package is no longer necessary. You can set `length` of a function using `Object.defineProperty`.
// example
const setFunctionLength = (fn, length) =>
Object.defineProperty(fn, 'length', {
value: length,
configurable: true,
});