Created
May 28, 2017 22:14
-
-
Save hadijaveed/b96b0b0d41a2a30143b621fd00ddb2ec to your computer and use it in GitHub Desktop.
Vanilla Counter Example
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
let totalCount = 0; | |
let render = count => document.getElementById('count').innerHTML = count; | |
document.getElementById('increment') | |
.addEventListener('click', () => { | |
totalCount += 1; | |
render(totalCount); | |
}); | |
document.getElementById('decerement') | |
.addEventListener('click', () => { | |
totalCount -= 1; | |
render(totalCount); | |
}); | |
render(totalCount); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment