ligo/gitlab-pages/docs/intro/src/what-and-why/counter.js
Matej Šima 628d818163 Revert "Merge with dev"
This reverts commit 6ffe220d928dc3137496bcea0cc0f4d72edc2846.
2019-11-07 23:19:27 +00:00

15 lines
232 B
JavaScript

var storage = 0;
function add(a) {
storage += a
}
function sub(a) {
storage -= a
}
// We're calling this function reset instead of default
// because `default` is a javascript keyword
function reset() {
storage = 0;
}