<sectionid="description"> Agora que você está obtendo dados de uma API JSON, é possível exibi-los no HTML. Você pode usar um método <code>forEach</code> para percorrer os dados, pois os objetos photo do cat são mantidos num array. Em cada item, você pode modificar os elementos HTML. Primeiro, declare uma variável html com <code>var html = "";</code> . Em seguida, percorra o JSON, adicionando HTML à variável que encapsula os nomes das chaves em tags <code>strong</code> , seguida do valor. Quando o loop terminar, você o renderiza. Aqui está o código que faz isso: <blockquote> json.forEach (function (val) { <br> var keys = Object.keys (val); <br> html + = "<div class = 'cat'>"; <br> keys.forEach (função (chave) { <br> html + = "<strong>" + chave + "</ strong>:" + val [tecla] + "<br>"; <br> }); <br> html + = "</ div><br>"; <br> }); </blockquote></section>
<sectionid="instructions"> Adicione um método <code>forEach</code> para fazer um loop pelos dados JSON e crie os elementos HTML para os exibir. Aqui está um exemplo de JSON <blockquote> [ <br> { <br>"id": 0, <br>"imageLink": "https://s3.amazonaws.com/freecodecamp/funny-cat.jpg", <br>"altText": "Um gato branco usando um capacete verde em forma de melão na cabeça.", <br>"codeNames": ["Juggernaut", "Sra. Wallace", "Buttercup"<br> ] <br> } <br> ] </blockquote></section>