Skip to content

Instantly share code, notes, and snippets.

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