# Не выводит список

**URL:** <https://forum.kirupa.com/t/topic/654270>\
**Category:** Uncategorized\
**Created:** [October 28, 2022, 4:03pm UTC](https://forum.kirupa.com/t/topic/654270 "2022-10-28T16:03:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![forumf](https://avatars.discourse-cdn.com/v4/letter/f/a6a055/32.png) [@forumf](https://forum.kirupa.com/u/forumf)\
**Post date:** [October 28, 2022, 4:03pm UTC](https://forum.kirupa.com/t/topic/654270/1 "2022-10-28T16:03:54Z")

</div>

```auto
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    
    <title>Document</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="cont">
        <h3>Список товаров</h3>
        <div id="products">

        </div>
    </div>
    <script>
        let arrProducts = [
            {id:1, name:"Вилка", price:2000},
            {id:2, name:"Ложка", price:2000},
            {id:3, name:"Тарелка", price:2000},
            {id:4, name:"Стакан", price:2000},
        ];
        for(let product of arrProducts){
            let newСardProduct = document.createElement("div");
        
            newCardProduct.innerHTML = `<h3>${product.name} </h3> <div>${product.price} </div>`;
            newCardProduct.innerHTML += `<div><button> edit </button> <button> del </button></div>`;

            products.append(newCardProduct);
        }
    </script>
</body>
</html>

```

Привет понимаю что ответа тут как правило не бывает но возможно кто то сталкивался подобным,код не выводит список что в нем не так?

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [October 28, 2022, 5:54pm UTC](https://forum.kirupa.com/t/topic/654270/2 "2022-10-28T17:54:01Z")

</div>

Can you please translate into English and edit your post? Thanks 🙂

---

<div class="post-metadata">

**Author:** ![forumf](https://avatars.discourse-cdn.com/v4/letter/f/a6a055/32.png) [@forumf](https://forum.kirupa.com/u/forumf)\
**Post date:** [October 29, 2022, 5:38pm UTC](https://forum.kirupa.com/t/topic/654270/3 "2022-10-29T17:38:56Z")

</div>

perhaps someone has come across a similar one, the code does not display a list, what is wrong with it?

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [October 30, 2022, 3:17am UTC](https://forum.kirupa.com/t/topic/654270/4 "2022-10-30T03:17:15Z")

</div>

The first thing you should do when your code isn’t working is check the DevTools console:

 ![image](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/c/7/c79dc43cf985da0e49f64177083416aa7fd16eae.png)

When I go back to my code editor to see what is going on, notice that the “C” in the variable declaration is a different “C” than what is being used in the next two lines:

 ![image](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/b/b/bbc1df1551c120e3a9687f470d9737bc825f718e.png)

If you make the “C” the same, that should get you further into seeing what may be wrong. One issue that I see is that “products” isn’t defined in your code:  
products.append(newCardProduct);  
You should make sure to associate a variable called **products** with your **products** id in the HTML.

Hope this helps!

Cheers,  
Kirupa 🙂

---

<div class="post-metadata">

**Author:** ![forumf](https://avatars.discourse-cdn.com/v4/letter/f/a6a055/32.png) [@forumf](https://forum.kirupa.com/u/forumf)\
**Post date:** [October 30, 2022, 7:28pm UTC](https://forum.kirupa.com/t/topic/654270/5 "2022-10-30T19:28:33Z")

</div>

сработало спасибо.

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [October 31, 2022, 4:26pm UTC](https://forum.kirupa.com/t/topic/654270/6 "2022-10-31T16:26:26Z")

</div>

Great. Please do translate your responses into English. It makes it easier for other users to follow along and benefit.
