Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Loops, Arrays and Objects Tracking Data Using Objects JavaScript Object Notation


What is JSON? Why, when and where to use? I am confused.

2 Answers

Eric M
Eric M
11,545 Points

JavaScript Object Notation is a flexible syntax for defining data structures. Despite the name it is used by multiple programming languages.

Its most common use case is in system to system communications over the internet. Many REST APIs send and receive payloads in JSON. Many also support XML. XML and JSON could be said to be trying to solve similar problems.

That said, when writing JavaScript programs you will often store data in or load data from a JSON format (if you need to store or load data) as well as using JSON for communicating with Web Service APIs.

Watch the Treehouse video Introducing JSON