Merge pull request #2077 from sanghyo95/patch-1

add semicolon
This commit is contained in:
Ilya Kantor 2020-08-27 16:47:38 +03:00 committed by GitHub
commit f983992700
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,14 +10,14 @@ function Calculator() {
let split = str.split(' '), let split = str.split(' '),
a = +split[0], a = +split[0],
op = split[1], op = split[1],
b = +split[2] b = +split[2];
if (!this.methods[op] || isNaN(a) || isNaN(b)) { if (!this.methods[op] || isNaN(a) || isNaN(b)) {
return NaN; return NaN;
} }
return this.methods[op](a, b); return this.methods[op](a, b);
} };
this.addMethod = function(name, func) { this.addMethod = function(name, func) {
this.methods[name] = func; this.methods[name] = func;