Learn JavaScript
JavaScript Object Notation
30.2
Lesson

JSON.stringify

For converting our object data into JSON we need the JSON.stringify() method:

In the example given above, the variable userInfoJSON stores the stringified version of the object userInfo.