Skip to content

Instantly share code, notes, and snippets.

@suhailgupta03
Created August 3, 2023 15:45
Show Gist options
  • Save suhailgupta03/ad3fa7dda4088e38e3eed8037ae5b59a to your computer and use it in GitHub Desktop.
Save suhailgupta03/ad3fa7dda4088e38e3eed8037ae5b59a to your computer and use it in GitHub Desktop.
// 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