166k views
0 votes
Please help explain this calculator code.

var calculator = {
sum: 0,
add: function(value) {
this.sum = this.sum + value;

},
clear: function() {[]
this.sum = 0;

},
equals: function() {
return this.sum;

}
}

User Lawchit
by
4.6k points

1 Answer

3 votes

Answer:

that looks really complicated. Try going to khan academy to get an explanation, they almost always have great explanations for things.

Step-by-step explanation:

User Muhamed Krasniqi
by
4.6k points