Adds JSON example to Convert JSON Data to HTML
Places JSON example inside a code block in the challenge description for campers to review while they work on the challenge.
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
b43ee80301
commit
d8bc1d7958
@ -414,7 +414,9 @@
|
|||||||
"Here's the code that does this:",
|
"Here's the code that does this:",
|
||||||
"<blockquote>json.forEach(function(val) {</br> var keys = Object.keys(val);</br> html += \"<div class = 'cat'>\";</br> keys.forEach(function(key) {</br> html += \"<strong>\" + key + \"</strong>: \" + val[key] + \"<br>\";</br> });</br> html += \"</div><br>\";</br>});</blockquote>",
|
"<blockquote>json.forEach(function(val) {</br> var keys = Object.keys(val);</br> html += \"<div class = 'cat'>\";</br> keys.forEach(function(key) {</br> html += \"<strong>\" + key + \"</strong>: \" + val[key] + \"<br>\";</br> });</br> html += \"</div><br>\";</br>});</blockquote>",
|
||||||
"<hr>",
|
"<hr>",
|
||||||
"Add a <code>forEach</code> method to loop over the JSON data and create the HTML elements to display it."
|
"Add a <code>forEach</code> method to loop over the JSON data and create the HTML elements to display it.",
|
||||||
|
"Here is some example JSON",
|
||||||
|
"<blockquote>[</br> {</br> \"id\":0,</br> \"imageLink\":\"https://s3.amazonaws.com/freecodecamp/funny-cat.jpg\",</br> \"altText\":\"A white cat wearing a green helmet shaped melon on it's head. \",</br> \"codeNames\":[</br> \"Juggernaut\",</br> \"Mrs. Wallace\",</br> \"Buttercup\"</br> ]</br> }</br>]</blockquote>"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"<script>",
|
"<script>",
|
||||||
|
Reference in New Issue
Block a user