ligo/gitlab-pages/docs/intro/src/what-and-why/counter.js

15 lines
232 B
JavaScript
Raw Normal View History

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;
}