Convert strings to numbers:
console.log(parseInt("42")) // 42
console.log(parseInt("42.9")) // 42 (truncates)
console.log(parseFloat("42.9")) // 42.9
console.log(parseInt("42px")) // 42 (stops at non-digit)
console.log(parseInt("abc")) // NaN
parseInt() returns an integer. parseFloat() preserves decimals. Both stop at the first invalid character.