Change variable declaration from var to let in description (#38150)

This commit is contained in:
rsapkf 2020-02-02 16:29:03 -05:00 committed by GitHub
parent 0e4a1408f8
commit cfbb3f64c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ forumTopicId: 16807
<section id='description'>
Now that you're getting data from a JSON API, you can display it in the HTML.
You can use a <code>forEach</code> method to loop through the data since the cat photo objects are held in an array. As you get to each item, you can modify the HTML elements.
First, declare an html variable with <code>var html = "";</code>.
First, declare an html variable with <code>let html = "";</code>.
Then, loop through the JSON, adding HTML to the variable that wraps the key names in <code>strong</code> tags, followed by the value. When the loop is finished, you render it.
Here's the code that does this: