bk commit

This commit is contained in:
2021-10-14 02:14:04 -03:00
parent f56746bf68
commit fac1305cfc
4 changed files with 53 additions and 18 deletions

View File

@@ -0,0 +1,26 @@
import Victory from "../Hangman/PuzzleWord/Victory";
const CheckVictory = (setIsVictory) => {
let allChildrenHaveText = true
const puzzleWord = document.getElementById('puzzleWord')
const childrens = [...puzzleWord.children]
childrens.forEach(children => {
if (children.textContent === '') {
allChildrenHaveText = false
}
});
console.log(allChildrenHaveText)
if (allChildrenHaveText) {
setIsVictory(true)
}
}
export default CheckVictory