en.javascript.info/1-js/04-object-basics/06-constructor-new/3-accumulator/_js.view/solution.js
Ilya Kantor 20784e7f26 up
2017-02-19 01:41:36 +03:00

8 lines
154 B
JavaScript

function Accumulator(startingValue) {
this.value = startingValue;
this.read = function() {
this.value += +prompt('How much to add?', 0);
};
}