Last active
March 27, 2018 12:41
-
-
Save filipproch/fdea683d311f4ec8f4d7cdcdb5a2b5fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void startNewGame() { | |
myCells.forEach((cellElement) => cellElement.setInnerHtml("a")); | |
} | |
// with function | |
void startNewGame() { | |
myCells.forEach(resetElement); | |
} | |
void resetElement(Element cellElement) { | |
cellElement.setInnerHtml("a"); | |
} | |
// the same, in different way | |
void startNewGame() { | |
for (var cellElement in myCells) { | |
cellElement.setInnerHtml("a"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment