<sectionid="description"> Теперь, когда вы получаете данные из JSON API, вы можете отобразить его в HTML. Вы можете использовать метод <code>forEach</code> для циклического прохождения данных, поскольку объекты фотографии cat хранятся в массиве. По мере перехода к каждому элементу вы можете изменить элементы HTML. Сначала объявите html-переменную с<code>var html = "";</code> , Затем прокрутите JSON, добавив HTML к переменной, которая обертывает имена ключей в <code>strong</code> тегах, а затем значение. Когда цикл закончен, вы его визуализируете. Вот код, который делает это: <blockquote> json.forEach (function (val) { <br> var keys = Object.keys (val); <br> html + = "<div class = 'cat'>"; <br> keys.forEach (функция (ключ) { <br> html + = "<strong>" + ключ + "</ strong>:" + val [key] + "<br>"; <br> }); <br> html + = "</ div><br>"; <br> }); </blockquote></section>
## Instructions
undefined
## Tests
<sectionid='tests'>
```yml
tests:
- text: Ваш код должен хранить данные в переменной <code>html</code>
testString: 'assert(code.match(/html\s+?(\+=|=\shtml\s\+)/g), "Your code should store the data in the <code>html</code> variable");'
- text: Ваш код должен использовать метод <code>forEach</code> для обработки данных JSON из API.
testString: 'assert(code.match(/json\.forEach/g), "Your code should use a <code>forEach</code> method to loop over the JSON data from the API.");'
- text: Ваш код должен обернуть имена ключевых слов <code>strong</code> тегами.
testString: 'assert(code.match(/<strong>.+<\/strong>/g), "Your code should wrap the key names in <code>strong</code> tags.");'