From the course: JSON Essential Training
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Convert an object or array to JSON - JavaScript Tutorial
From the course: JSON Essential Training
Convert an object or array to JSON
- [Instructor] When you want to transmit data, especially on the web, you generally need to convert it to JSON. There are other formats in use. So depending on the system you're sending data to, you may instead need to convert to one of them. Other popular notations for data sharing include YAML, which stands for yet another markup language and XML or extensible markup language. JSON is common, but by no means universal. So if you find you need to learn how to work with a different notation, check out a course here in the library to help you get started. But JSON is by far the most popular on the web. And whether you have an object or an array that you want a stringify into JSON, the process is pretty straightforward in JavaScript. The built-in method is pretty self-explanatory, JSON.stringify. In JavaScript or any other language, the process simply involves passing the structure to the utility method, which returns…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.