Skip to content

Commit 8f2a2b9

Browse files
committed
Alter wording about JSON objects
1 parent 074fb2f commit 8f2a2b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Test out the button in the browser and use the network tab of the developer tool
2626
{"cats": [{"id":44,"name":"Lanta","photo":"https://s3.amazonaws.com/bitmakerhq/resources/web-development/bitkittens/lanta.jpg","fun_fact":"Likes to pretend she is a cat","created_at":"2016-06-30T20:11:32.647Z","updated_at":"2016-06-30T20:11:32.647Z"},{"id":41,"name":"Timone","photo":"https://s3.amazonaws.com/bitmakerhq/resources/web-development/bitkittens/timone.jpg","fun_fact":"He likes to dress fancy","created_at":"2016-06-30T20:11:32.559Z","updated_at":"2016-06-30T20:11:32.559Z"},{"id":47,"name":"Sahara","photo":"https://s3.amazonaws.com/bitmakerhq/resources/web-development/bitkittens/sahara.jpg","fun_fact":"likes laser pointers and is a nap enthusiast","created_at":"2016-06-30T20:11:32.775Z","updated_at":"2016-06-30T20:11:32.775Z"}]}
2727
```
2828

29-
The response data you get back from the server is a JSON object containing an array of cat objects. You can access values in a JSON object similarly to how you would access values from a Ruby hash. For example, given the following JSON object:
29+
The response data you get back from the server is a blob of JSON containing an array of cat objects. JQuery will convert this blob into an object on your behalf, and then you can access values similarly to how you would access values from a Ruby hash. For example, given the following JSON data:
3030

3131
```json
3232
var dogJSON = {"puppies": [{"name": "Charlie", "owner": "Ella"}, {"name": "Abbey", "owner": "Dima"} ]};
@@ -38,7 +38,7 @@ the following code would return the array of dog objects:
3838
var dogList = dogJSON["puppies"];
3939
```
4040

41-
Each element in that array is its own JSON object, so the code to get the name of the first dog would look like:
41+
Each element in that array is its own object, so the code to get the name of the first dog would look like:
4242

4343
```js
4444
dogList[0]["name"] // returns "Charlie"

0 commit comments

Comments
 (0)