Ⓜ️.valueOf()
🚧 under construction
JS ⟩ value ⟩ type ⟩ conversion ⟩ .valueOf()
⚖️ valueOf vs. toString
- valueOf is called in priority by numeric conversion and primitive conversion. 
- string conversion calls toString() in priority. 
- .toString() - object -> string 
- Object.prototype.toString() - object -> string. 
- Object.prototype.valueOf() - object -> (primitive) value, if possible. 
Last updated
Was this helpful?