`Number()`
and `parseInt`
accept the spaces in input. But be aware that you could get different result when passing a value with spaces as following:parseInt(' 5 '); // 5parseInt('12 345'); // 12, not 12345
parseInt(value.replace(/\s+/g, ''), 10);