JS: Removed unecessary, not working code
This commit is contained in:
		
							parent
							
								
									1746e2437c
								
							
						
					
					
						commit
						e85acb81f0
					
				
							
								
								
									
										17
									
								
								script.js
								
								
								
								
							
							
						
						
									
										17
									
								
								script.js
								
								
								
								
							|  | @ -28,11 +28,10 @@ function operate(equals) { | |||
| } | ||||
| 
 | ||||
| function execute(operation) { | ||||
|     if (operation.equal) { | ||||
|         const result = operate(operation); | ||||
|     if ("" in operation) { | ||||
|         console.log("BLANK IS HERE"); | ||||
|     } | ||||
|         operation.a_b = !operation.a_b; | ||||
|         operation.equal = false; | ||||
|         operation.operator = ""; | ||||
|         if (operation.a_b) { | ||||
|             operation.a = `${result}`; | ||||
|  | @ -41,12 +40,14 @@ function execute(operation) { | |||
|         console.table(operation); | ||||
|         console.log(`Result: ${result}`); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| let operation = { | ||||
|     a: "", | ||||
|     operator: "", | ||||
|     b: "", | ||||
|     a_b: true, | ||||
|     equal: false, | ||||
| } | ||||
| 
 | ||||
| let equal = ""; | ||||
|  | @ -57,21 +58,21 @@ function click(value) { | |||
|             operation.a += value; | ||||
|         } else { | ||||
|             operation.b += value; | ||||
|             operation.equal = true; | ||||
|         } | ||||
|     } else if (value == "=") { | ||||
|         execute(operation); | ||||
|     } else { | ||||
|         if (operation.operator == "") { | ||||
|             operation.a_b = !operation.a_b; | ||||
|         } | ||||
|             operation.operator = value; | ||||
|         } | ||||
|     console.table(operation); | ||||
| 
 | ||||
|     if ("" in operation) { | ||||
|         console.log("BLANK IS HERE"); | ||||
|         if (operation.a_b) { | ||||
|             operation.operator = value; | ||||
|         } | ||||
|     } | ||||
|     console.table(operation); | ||||
| } | ||||
| 
 | ||||
| function generateGui() { | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue