Remember people, when Javascript expect a string, it will convert whatever in front of it to a string. Every object inherit tostring (its a property of object) , therefore every object behave as a string. Its a consistent behavior
If you learn how the prototype system of JS work, it is really intuitive
View all comments
1
u/MajorTechnology8827 Mar 20 '24
Remember people, when Javascript expect a string, it will convert whatever in front of it to a string. Every object inherit tostring (its a property of object) , therefore every object behave as a string. Its a consistent behavior
If you learn how the prototype system of JS work, it is really intuitive