valueOfintermediate// Retrieve the primitive numeric value
const n = new Number(42)
n.valueOf() // β 42
typeof n.valueOf() // β 'number'Use valueOf() on a Number object to extract the underlying primitive number value, which JavaScript also calls automatically in numeric expressions.
numObj.valueOf() returns the primitive numeric value wrapped by a Number object.
new Number(42).valueOf() // β 42