The Number() function is stricter:
console.log(Number("42")) // 42
console.log(Number("42.9")) // 42.9
console.log(Number("42px")) // NaN (won't parse partial)
console.log(Number("")) // 0
Use parseInt/parseFloat when the string might have trailing text. Use Number() when you want strict conversion that fails on invalid input.