You only get number till where it is meaningful when converting from string to number.
console.log(parseInt('01abbb')) // 1 -> it is started by 01 before chars
console.log(parseInt('31xyz')) // 31 -> it is started by 31 before chars
console.log(parseInt('zyz31')) // NaN -> it is not started by numbers
console.log(parseInt('31xyz1')) // 31 -> it is started by 31 before chars