From the course: JSON Essential Training
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Structure JSON by following the rules - JavaScript Tutorial
From the course: JSON Essential Training
Structure JSON by following the rules
- [Instructor] The basic structure of both JavaScript objects and JSON that stores key value pairs starts and ends with a curly brace. For JavaScript arrays and JSON that stores an ordered list of values, the beginning and ending characters are square brackets. The array format has all the same rules as the object format and objects are subject to a few additional rules. So let's compare a JavaScript object and its JSON representation. In JavaScript, the key doesn't require punctuation around it, but it's okay to specify it in single quotes or in double quotes. In JSON, the key must be surrounded in double quotes. So in JavaScript, I don't need quotes at all on the left, but in JSON I do. In both, the key is followed by a colon. A value in a JavaScript object can store different types of data, including strings, numbers, true false values, and even more complex nested structures like arrays and other objects. In…
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.
Contents
-
-
-
What is JSON?1m 49s
-
(Locked)
Understand objects in programming2m 25s
-
(Locked)
Structure JSON by following the rules4m 7s
-
Build a basic JSON structure3m 50s
-
(Locked)
Build a nested JSON structure2m 45s
-
(Locked)
Challenge: Debug a JSON structure and create your own1m 45s
-
(Locked)
Solution: Debug a JSON structure and create your own3m 53s
-
-
-
-
-
-
-