valueOf() method returns the primitive value of an object.
valueOf() method converts the this value to an object.
valueOf() method is meant to be overridden by derived objects for custom type conversion logic.
valueOf() method does not accept any parameter.
valueOf() method returns the object itself if the object has no primitive value.
valueOf() method does not change the original object.
For objects of type Object there is no primitive value, and this method simply returns the object itself.
For objects of type Number, Boolean, or String however, valueOf() returns the primitive value represented by the corresponding object.
myObject.valueOf()