# named function vs expression function

# articles

# hoisting

Hoisting : developer.mozilla.org

variable and function declarations are put into memory during the compile phase

Hoisting is not available with expression function where the declaration order impact function usage.

function catName(name) {
  console.log("My cat's name is " + name);
}

catName("Tigger");
/*
The result of the code above is: "My cat's name is Tigger"
*/
1
2
3
4
5
6
7
8
catName("Chloe");

function catName(name) {
  console.log("My cat's name is " + name);
}
/*
The result of the code above is: "My cat's name is Chloe"
*/
1
2
3
4
5
6
7
8