0 points

JSON.stringify() - convert objects into JSON


Sun Jan 19 2020 18:56:05 GMT+0000 (UTC)

Posted by @storiesreptile #javascript #json #jsfunctions

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

var person = JSON.stringify(profile);
content_copy Copy

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".