Returns the primitive value of the object.
valueOf()
A primitive boolean value (true or values).
var boolObject = new Boolean(true)
var boolPrimitive = boolObject.valueOf()
print("Object's type is", typeof boolObject)
print("Primitive's type is", typeof boolPrimitive)
print("Equal?", boolObject == boolPrimitive)
print("Strictly equal?", boolObject === boolPrimitive)
Object's type is object
Primitive's type is boolean
Equal? true
Strictly equal? false
typeof new Boolean(true).valueOf()