15 lines
232 B
JavaScript
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;
|
||
|
}
|