Object Conversions

Can anyone pls explain in brief what are the important and necessary object to primitive conversions in brief. or object conversions with egs
10 Replies
ἔρως
ἔρως3d ago
what do you mean?
Vandana
Vandana3d ago
Thanks for responding. Object to primitive type conversions.
Vandana
Vandana3d ago
GeeksforGeeks
How to convert an object to string using JavaScript ? - GeeksforGeeks
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
ἔρως
ἔρως3d ago
usually, you do it because you need it there's 3 ways to do it: - toString - toValue - Symbol.toPrimitive
Vandana
Vandana2d ago
when do we come across these?
clevermissfox
clevermissfox2d ago
the example that immediately comes to mind is when we are retrieving and sending data between browser storage and our application. JSON.parse() and JSON.stringify()
Vandana
Vandana2d ago
yea true. and these?
ἔρως
ἔρως2d ago
you almost never will use these this is a reasonable usage of those, but, even then, it's super specific
Vandana
Vandana2d ago
yup. so no need to worry about these.
ἔρως
ἔρως2d ago
you should know they exist, but don't worry an awful lot about those