'use strict';
let newGame = document.querySelector('.btn--new');
let Score = document.querySelectorAll('.score');
let currentScore = document.querySelectorAll('.current-score');
function initializeGame() {
for (let i = 0; i < Score.length; i++) {
Score[i].textContent = '0';
console.log(Score[i].textContent);
}
}
newGame.addEventListener('click', initializeGame);
<html>
<body>
<h2 class="name" id="name--0">Player 1</h2>
<p class="score" id="score--0">43</p>
<h2 class="name" id="name--1">Player 2</h2>
<p class="score" id="score--1">24</p>
<button class="btn btn--new">New game</button>
<script src="script.js"></script>
</body>
</html>
// when i press the new game button it does not print the context of the paragraph with score class in it