function toInt(number) {return Infinity === number ? 0 : (number*1 || 0).toFixed(0)*1;}function toInt2(_val) {let val = `${_val}`val = val.replace(/[^\d]/g, '')return val}const a = 0001const num1 = toInt(a)const num2 = toInt2(a)const num3 = toInt(toInt2(a))console.log('num3: ', num3); // num3: 1
