Created
August 3, 2023 15:34
-
-
Save suhailgupta03/969a4a856c0a43b9e898ba80eb133078 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
// function sum(a, b) { | |
// return a + b; | |
// } | |
// let v = sum(99, 1); | |
// console.log(v); | |
var x = function sum(a, b) { | |
return a + b; | |
} // x is a function | |
// the reason x is a function is because it is a | |
// variable that is assigned to a function | |
// these are called function expressions | |
// because the function is assigned to a variable | |
// and the variable can be used as a function | |
let v = x(99, 1); | |
console.log(v); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment