{"size": 762, "ext": "js", "max_stars_repo_path": "js/main.js", "max_stars_repo_name": "GeneralFPSIza/JavaScript_2", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "js/main.js", "max_issues_repo_name": "GeneralFPSIza/JavaScript_2", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/main.js", "max_forks_repo_name": "GeneralFPSIza/JavaScript_2", "max_forks_repo_forks_event_min_datetime": "2021-07-26T11:20:00.000Z", "max_forks_repo_forks_event_max_datetime": "2021-07-26T11:20:00.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 27.2142857143, "max_line_length": 64, "alphanum_fraction": 0.5524934383}
'use strict';
const products = [
    {id: 1, title: 'Notebook', price: 1000},
    {id: 2, title: 'Mouse', price: 100},
    {id: 3, title: 'Keyboard', price: 250},
    {id: 4, title: 'Gamepad', price: 150},
];

const renderProduct = (title, price) => {
    return `<div class="product-item">
                <h3>${title}</h3>
                <img src='img/undefined.jpg'>
                <p>${price}</p>
                <button class="by-btn">Добавить</button>
              </div>`;
}

const renderProducts = (list) => {
    const productList = list.map((item) => {
        return renderProduct(item.title, item.price);
    }).join('');

    console.log(productList);
    document.querySelector('.products').innerHTML = productList;
}

renderProducts(products);
