stubString()
stubString():
string
Returns an empty string.
DEPRECATED
Use an inline arrow function () => '' instead.
Returns: stringโ
An empty string.
Sinceโ
2.0.0
Also known asโ
stubString (Lodash, es-toolkit) ยท โ (Remeda, Radashi, Ramda, Effect, Modern Dash, Antfu)
Exampleโ
// โ Deprecated approach
stubString(); // => ''
// โ
Recommended approach
(() => '')(); // => ''
How it works?โ
Returns an empty string.
Deprecated: Use () => '' directly.
Native Equivalentโ
// โ stubString
// โ
() => ''
Use Casesโ
Return empty string ๐โ
Return empty string as default.
const getDefault = () => '';
Fallback valueโ
Use empty string as fallback.
const name = user.name ?? '';