Created
July 31, 2023 16:34
-
-
Save suhailgupta03/d15f48b0d725c01e6c4f4d851c18ee7d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the reason we have functions is to avoid | |
// repeating code | |
function sum(arg1, arg2) { | |
var number1 = arg1; | |
var number2 = arg2; | |
var sumOfNumbers = number1 + number2; | |
console.log(sumOfNumbers); | |
} | |
sum(1, 2); | |
sum(100, 200); | |
sum(1000, 2000); | |
// In the above statement, we are calling the function SOME_NAME() | |
// and it will print the sum of the numbers. | |
// calling the function means that we are asking the function | |
// to execute the code inside it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment