This commit is contained in:
Ilya Kantor 2017-02-19 01:41:36 +03:00
parent d7d25f4d8b
commit 20784e7f26
48 changed files with 302 additions and 397 deletions

View file

@ -1,17 +1,13 @@
function Calculator() {
var methods = {
"-": function(a, b) {
return a - b;
},
"+": function(a, b) {
return a + b;
}
let methods = {
"-": (a, b) => a - b,
"+": (a, b) => a + b
};
this.calculate = function(str) {
var split = str.split(' '),
let split = str.split(' '),
a = +split[0],
op = split[1],
b = +split[2]