Trims strings and removes zero-width spaces/BOMs. Accepts finite numbers explicitly; rejects other types without invoking user-defined coercion.
Any value.
The trimmed string without zero-width characters, a finite number as text, or '' for anything else or strings over 1,024 characters.
''
cleanString(' 921234567V '); // '921234567V'cleanString(42); // '42'cleanString({}); // '' Copy
cleanString(' 921234567V '); // '921234567V'cleanString(42); // '42'cleanString({}); // ''
Trims strings and removes zero-width spaces/BOMs. Accepts finite numbers explicitly; rejects other types without invoking user-defined coercion.