fix(curriculum): change "assert" to "from" and remove videoId (#61446)

This commit is contained in:
Vivaan Teotia
2025-07-23 19:06:43 +05:30
committed by GitHub
parent 64b32cf69b
commit 08e0f07a96

View File

@@ -1,17 +1,12 @@
---
id: 6732b788046862264eeb1c39
title: What Is JSON, and How Do You Access Values Using Bracket and Dot Notation?
challengeType: 11
videoId: 8x6vJarVy_o
challengeType: 19
dashedName: what-is-json-and-how-do-you-access-values-using-bracket-and-dot-notation
---
# --description--
Watch the video or read the transcript and answer the questions below.
# --transcript--
What is JSON and how do you access values using bracket and dot notation?
JSON stands for JavaScript Object Notation. It is a lightweight, text-based data format that is commonly used to exchange data between a server and a web application.
@@ -38,7 +33,7 @@ As you can see, JSON uses key-value pairs to store information and each pair is
To access data from a JSON object, you can either use dot or bracket notation. In this example, we are using dot notation to access the `age` from the JSON object:
```js
import data from "./example.json" assert { type: "json" };
import data from "./example.json" with { type: "json" };
console.log(data.age);
```
@@ -48,7 +43,7 @@ This particular example is using what is known as an `import` statement, which i
You can also use bracket notation to access information from JSON objects. Here is an example of accessing the `list of courses` array:
```js
import data from "./example.json" assert { type: "json" };
import data from "./example.json" with { type: "json" };
console.log(data["list of courses"]);
```