Learning JavaScript? Download my free JavaScript Handbook 🔥

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.

Edit this page

Here's my latest YouTube video. I talk about work/life balance as a developer: