Skip to content

Instantly share code, notes, and snippets.

@filipproch
Last active March 27, 2018 12:41
Show Gist options
  • Save filipproch/fdea683d311f4ec8f4d7cdcdb5a2b5fd to your computer and use it in GitHub Desktop.
Save filipproch/fdea683d311f4ec8f4d7cdcdb5a2b5fd to your computer and use it in GitHub Desktop.
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