diff --git a/index.html b/index.html index 97cb689..01c31e4 100644 --- a/index.html +++ b/index.html @@ -8,6 +8,5 @@ - \ No newline at end of file diff --git a/script.js b/script.js index e69de29..413003a 100644 --- a/script.js +++ b/script.js @@ -0,0 +1,34 @@ +function add(a, b) { + return a + b; +} + +function substract(a, b) { + return a - b; +} + +function multiply(a, b) { + return a * b; +} + +function divide(a, b) { + return a / b; +} + +function operate(equals) { + switch(equals.operator) { + case "+": + return add(equals.a, equals.b); + case "-": + return substract(equals.a, equals.b); + case "*": + return multiply(equals.a, equals.b); + case "/": + return divide(equals.a, equals.b); + } +} + +let operation = { + a: 0, + operator: "+", + b: 0, +} \ No newline at end of file