diff --git a/functions/sum/exercise/index.html b/functions/sum/exercise/index.html index 41e979a..e9d83a0 100644 --- a/functions/sum/exercise/index.html +++ b/functions/sum/exercise/index.html @@ -1,27 +1,27 @@ - - - - - - - replit - - - - - - - - - - - - \ No newline at end of file diff --git a/functions/sum/exercise/script.js b/functions/sum/exercise/script.js index 69d6b48..dd5dba9 100644 --- a/functions/sum/exercise/script.js +++ b/functions/sum/exercise/script.js @@ -1,30 +1,30 @@ -/* - TODO: Write a function that sums two numbers - TODO: Write a function that subtracts two numbers - TODO: Write a function that divides two numbers. - TODO: Write a function that multiplies two numbers. - *NOTE* be sure to handle dividing by zero 😉 - ES5 Syntax: function Add(){} - ES6 Syntax (Arrow function): const add = () => {} -*/ - -function add(){ - //Add function here -} - -function sub(){ - //Subtract function here -} - -function div(){ - //Divide function here -} - -function mul(){ - //Multiply function here -} - -console.log('hello from the SUM exercise') -/* - TODO: create a function that console logs the result of any of the above operations. +/* + TODO: Write a function that sums two numbers + TODO: Write a function that subtracts two numbers + TODO: Write a function that divides two numbers. + TODO: Write a function that multiplies two numbers. + *NOTE* be sure to handle dividing by zero 😉 + ES5 Syntax: function Add(){} + ES6 Syntax (Arrow function): const add = () => {} +*/ + +function add(){ + //Add function here +} + +function sub(){ + //Subtract function here +} + +function div(){ + //Divide function here +} + +function mul(){ + //Multiply function here +} + +console.log('hello from the SUM exercise') +/* + TODO: create a function that console logs the result of any of the above operations. */ \ No newline at end of file diff --git a/functions/sum/solution/index.html b/functions/sum/solution/index.html index 1a14a2f..c51f796 100644 --- a/functions/sum/solution/index.html +++ b/functions/sum/solution/index.html @@ -1,7 +1,7 @@ - - Sum - Solution - - - - + + Sum - Solution + + + + \ No newline at end of file diff --git a/functions/sum/solution/script.js b/functions/sum/solution/script.js index 6a567a7..cdc38b0 100644 --- a/functions/sum/solution/script.js +++ b/functions/sum/solution/script.js @@ -1 +1,41 @@ -console.log("Sum solution")) \ No newline at end of file +/* + TODO: Write a function that sums two numbers + TODO: Write a function that subtracts two numbers + TODO: Write a function that divides two numbers. + TODO: Write a function that multiplies two numbers. + *NOTE* be sure to handle dividing by zero 😉 + ES5 Syntax: function Add(){} + ES6 Syntax (Arrow function): const add = () => {} +*/ + +// function add(){ +// //Add function here +// } +const sum = (a, b) => { + return a + b + } + + const sub = (a, b) => { + return a - b + } + + const div = (a, b) => { + if(b === 0){ + console.log('Cannot divide by 0'); + } else { + return a / b + } + } + + const mul = (a, b) => { + return a * b + } + + console.log(sum(10, 4)); + console.log(sub(10, 4)); + console.log(div(10, 2)); + console.log(mul(10, 4)); + + /* + TODO: create a function that console logs the result of any of the above operations. + */ \ No newline at end of file diff --git a/index.html b/index.html index a0d6899..ac744f6 100644 --- a/index.html +++ b/index.html @@ -1,57 +1,58 @@ -
- - - - - - - - - - - - - - replit - - - - - -

Official Github REPO (🌟 Go Star This ♥️)

-

👉 JavaScript Course by Clever Programmer (Github Repo)

-

Let's get this trending 🚀

-

Lessons

- DOM - Red Yellow Green Squares -
- API - Get Random Dog -
- API - Get Super Heroes
- Classes - Bank with Deposit & Withdraw Methods - -

Project Exercises

- Stopwatch
- Rock Paper Scissors
- Figthing Game
- Tip Calculator -
- Weather App - -

Project Solutions

- Stopwatch
- Rock Paper Scissors
- Fighting Game
- Tip Calculator -
- Weather App -
- Create Netflix - - - - - - - - +
+ + + + + + + + + + + + + + replit + + + + + +

Official Github REPO (🌟 Go Star This ♥️)

+

👉 JavaScript Course by Clever Programmer (Github Repo)

+

Let's get this trending 🚀

+

Lessons

+ DOM - Red Yellow Green Squares +
+ API - Get Random Dog +
+ API - Get Super Heroes
+ Classes - Bank with Deposit & Withdraw Methods + +

Project Exercises

+ Sum
+ Stopwatch
+ Rock Paper Scissors
+ Figthing Game
+ Tip Calculator +
+ Weather App + +

Project Solutions

+ Stopwatch
+ Rock Paper Scissors
+ Fighting Game
+ Tip Calculator +
+ Weather App +
+ Create Netflix + + + + + + + + \ No newline at end of file