<sectionid="description"> الآن بعد أن حصلت على بيانات من JSON API ، يمكنك عرضها في HTML. يمكنك استخدام طريقة <code>forEach</code> خلال البيانات حيث يتم الاحتفاظ بكائنات صور القطة في صفيف. عند الوصول إلى كل عنصر ، يمكنك تعديل عناصر HTML. أولاً ، قم بتعريف متغير html بـ <code>var html = "";</code> . ثم ، قم بالتكرار عبر JSON ، مع إضافة HTML إلى المتغير الذي يلف أسماء المفاتيح في علامات <code>strong</code> ، متبوعًا بالقيمة. عند الانتهاء من الحلقة ، يمكنك جعلها. إليك الرمز الذي يفعل هذا: <blockquotestyle=";text-align:right;direction:rtl"> json.forEach (وظيفة (val) { <br> مفاتيح var = Object.keys (val)؛ <br> html + = "<div class = 'cat'>"؛ <br> keys.forEach (وظيفة (مفتاح) { <br> html + = "<strong>" + key + "</ strong>:" + val [key] + "<br>"؛ <br> })؛ <br> html + = "</ div><br>"؛ <br> })؛ </blockquote></section>
## Instructions
<sectionid="instructions"> إضافة أسلوب <code>forEach</code> لحلقة عبر بيانات JSON وإنشاء عناصر HTML لعرضه. إليك بعض الأمثلة على JSON <blockquotestyle=";text-align:right;direction:rtl"> [ <br> { <br>"الهوية": 0، <br>"IMAGELINK": "https://s3.amazonaws.com/freecodecamp/funny-cat.jpg"<br>"altText": "قطة بيضاء ترتدي خوذة خضراء على شكل البطيخ على رأسها."، <br>"codeNames": ["Juggernaut"، "Mrs. Wallace"، "Buttercup"<br> ] <br> } <br> ] </blockquote></section>
## 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> أسلوب <code>forEach</code> لإجراء <code>forEach</code> عبر بيانات JSON من واجهة برمجة التطبيقات.
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: ''
testString: 'assert(code.match(/<strong>.+<\/strong>/g), "Your code should wrap the key names in <code>strong</code> tags.");'