Skip to content

Commit 7899cde

Browse files
committed
Remove unnecessary code.
1 parent 093a86b commit 7899cde

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

script.js

+2-14
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Calculator.prototype = {
3333
var str = this.str;
3434
var reg = /[^1-9,0,*,/,\-,+,%, ,(,)]/g;
3535
var result = str.match(reg);
36-
// return ;
3736
if (result || str.endsWith("+") || str.endsWith("-") || str.endsWith("*") || str.endsWith("/")) {
3837
return "Invalid: " + (result || "End of character.");
3938
}
@@ -51,7 +50,6 @@ Calculator.prototype = {
5150
clear: function () {
5251
this.str = 0;
5352
this.updateDisplay();
54-
// console.log(this.output());
5553
},
5654

5755
createLayout: function () {
@@ -68,7 +66,6 @@ Calculator.prototype = {
6866

6967
},
7068

71-
//no function
7269
createButton (text, i) {
7370
var button = document.createElement("button");
7471
button.innerHTML = text;
@@ -78,7 +75,7 @@ Calculator.prototype = {
7875

7976
},
8077

81-
buttonObserver(a) {
78+
buttonObserver (a) {
8279
var currentCalc = document.myCalculators[0];
8380
if (a == "C") {
8481
currentCalc.clear();
@@ -91,7 +88,7 @@ Calculator.prototype = {
9188
}
9289
},
9390

94-
createBody() {
91+
createBody () {
9592
var cBody = document.createElement("div");
9693
cBody.id = "c-body";
9794
cBody.className = "c-body";
@@ -115,13 +112,4 @@ Calculator.prototype = {
115112
};
116113

117114
var a = new Calculator("myCalculator");
118-
//sum("51 + (5 / 2 * 85 + 1)");//Invalid: End of character.
119-
//sum("5 / 2 * 85 + 1asd"); // Invalid: a,s,d
120-
//sum("5 + (5 / 2 * 85 + 1)") // 218.5
121-
122-
123-
//a.clear();
124-
125-
//function sum(string) { a.input(string) }
126-
127115

0 commit comments

Comments
 (0)