Called on an object instance, returns the primitive value of it.

const person = { name: 'Fred' }
person.valueOf() //{ name: 'Fred' }

This is normally only used internally by JavaScript, and rarely actually invoked in user code.

Download my free JavaScript Beginner's Handbook and check out my JavaScript Course!


Follow me on Twitter @flaviocopes