Make example in Manipulate Complex Obj consistent
This commit is contained in:
@ -4713,7 +4713,7 @@
|
||||
"description": [
|
||||
"Sometimes you may want to store data in a flexible <dfn>Data Structure</dfn>. A JavaScript object is one way to handle flexible data. They allow for arbitrary combinations of <dfn>strings</dfn>, <dfn>numbers</dfn>, <dfn>booleans</dfn>, <dfn>arrays</dfn>, <dfn>functions</dfn>, and <dfn>objects</dfn>.",
|
||||
"Here's an example of a complex data structure:",
|
||||
"<blockquote>var ourMusic = [<br> {<br> \"artist\": \"Daft Punk\",<br> \"title\": \"Homework\",<br> \"release_year\": 1997,<br> \"formats\": [ <br> \"CD\", <br> \"Cassette\", <br> \"LP\" ],<br> \"gold\": true<br> }<br>];</blockquote>",
|
||||
"<blockquote>var ourMusic = [<br> {<br> \"artist\": \"Daft Punk\",<br> \"title\": \"Homework\",<br> \"release_year\": 1997,<br> \"formats\": [ <br> \"CD\", <br> \"Cassette\", <br> \"LP\"<br> ],<br> \"gold\": true<br> }<br>];</blockquote>",
|
||||
"This is an array which contains one object inside. The object has various pieces of <dfn>metadata</dfn> about an album. It also has a nested <code>\"formats\"</code> array. If you want to add more album records, you can do this by adding records to the top level array.",
|
||||
"Objects hold data in a property, which has a key-value format. In the example above, <code>\"artist\": \"Daft Punk\"</code> is a property that has a key of <code>\"artist\"</code> and a value of <code>\"Daft Punk\"</code>.",
|
||||
"<a href='http://www.json.org/' target=_blank>JavaScript Object Notation</a> or <code>JSON</code> is a related data interchange format used to store data.",
|
||||
@ -4730,9 +4730,10 @@
|
||||
" \"title\": \"Piano Man\",",
|
||||
" \"release_year\": 1973,",
|
||||
" \"formats\": [ ",
|
||||
" \"CS\", ",
|
||||
" \"8T\", ",
|
||||
" \"LP\" ],",
|
||||
" \"CS\",",
|
||||
" \"8T\",",
|
||||
" \"LP\"",
|
||||
" ],",
|
||||
" \"gold\": true",
|
||||
" }",
|
||||
" // Add record here",
|
||||
|
Reference in New Issue
Block a user