Вот прям совсем интересно
script.js
const cards=document.querySelectorAll ('.card');
let opened = [];
let matched = 0;
let moves = 0;
cards.forEach((card) => {
card.onclick= () => {
card.classList.add ('opened');
}
})
function init () {
matched=0;
moves=0;
}
init();