Animations

API

Arrays

Async

Basics

Challenges

Classes

Console

Dates

Debugging

DOM Elements

DOM Methods

DOM Navigation

DOM Properties

Event Listeners

Flow Control

Forms

Functions

Global Functions

JSON

Keywords

Libraries (3rd party)

Math

Modules

Objects

Snippets

String

Types

Widgets

Window Object

JavaScript - Stringify

To create a JSON Object FROM text or a string (usually from another source, we can use the JSON.parse method. The opposite, reverse process is to use JSON.stringify({...object...as...string...}).

Imagine we have this object in JavaScript:
let Dude = { "name":"John", "age":30, "city":"New York"};

Use the JavaScript function JSON.stringify() to convert it into a string.
let myJSON = JSON.stringify(Dude)