We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd23f31 commit 42e281dCopy full SHA for 42e281d
javaScriptCalculator/script.js
@@ -66,15 +66,24 @@ class Calculator {
66
this.leaveZero();
67
}
68
69
+ // not wroking
70
backOne() {
71
this.state.monitor.pop();
72
this.state.output = this.state.monitor.join("");
73
this.render();
- console.log(this.state)
74
+ console.log(this.state.monitor)
75
+ if (this.state.output === "") {
76
+ this.state.output = "0";
77
+ }
78
79
80
total() {
- const total = eval(this.state.monitor.join(""));
81
+ // give something wrong and see how it works
82
+ try{
83
+ var total = eval(this.state.monitor.join(""));
84
+ }catch(e){
85
+ total = e;
86
87
88
this.state = {
89
output: total,
0 commit comments