JSON.stringify() - convert objects into JSON

PHOTO EMBED

Sun Jan 19 2020 18:56:05 GMT+0000 (Coordinated Universal Time)

Saved by @storiesreptile #javascript #json #jsfunctions

var profile = {
  name: 'John',
  age: 25,
  isAdmin: false,
  courses: ['html', 'css', 'js']
};

var person = JSON.stringify(profile);
content_copyCOPY

Lines 1-6: Declaring a JSON object and storing it in the variable "profile". Line 8: Convert "profile" into a string and storing it in variable "person".