String.prototype.valueOfintermediateconst str = 'Hello'
str.valueOf() // β 'Hello'
new String('hi').valueOf() // β 'hi'Use valueOf() to return the primitive string value, useful when working with String wrapper objects.
A String object wraps a primitive. valueOf() unwraps it to a primitive.
Challenge: Implement objectValueOf(strObj) that extracts the primitive from a String object.
objectValueOf(new String('hello')) // β 'hello'