Created
August 3, 2023 15:45
-
-
Save suhailgupta03/ad3fa7dda4088e38e3eed8037ae5b59a 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; | |
// } | |
// const x = function sum(a, b) { | |
// return a + b; | |
// } // function expression | |
// // because it is assigned to a variable | |
const x = function (a, b) { | |
return a + b; | |
} // anonymous function expression | |
// still a function expression because it is | |
// assigned to a variable | |
// but it is anonymous because it does not have a name | |
console.log(x(1,2)); | |
// anonymous means without a name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment