> For the complete documentation index, see [llms.txt](https://eleven-fifty-academy.gitbook.io/javascript-101-fundamentals/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eleven-fifty-academy.gitbook.io/javascript-101-fundamentals/1-javascript-fundamentals/1-js-fundamentals/4-functions/expressions.md).

# Expressions

## Rules

1. Can be anonymous.
2. Cannot be hoisted.

## File Location

We will be working in the following file:

```
    javascript-library
        └── 0-PreWork
        └── 1-Fundamentals
            └── 1-Grammar-and-Types
            └── 2-ControlFlow-and-ErrorHandling
            └── 3-Loops
            └── 4-Functions
                02-expressions.js <----You will be working in this file.
```

## Anonymous Functions

When we say that function expressions can be anonymous, you'll see below that the function does not have a name after the `function` keyword is used:

```javascript
var sayHello = function(){
    console.log("Hello");
}
```

## Naming a function expression

You can also put a name on a function expression:

```javascript
var sayHowdy = function howdy(){
    console.log("Howdy");
}

//Printing the value
console.log(sayHowdy());
```

## No Hoisting

Function expressions CAN NOT be hoisted in JavaScript. This means that the call can not come before the function is declared.

```javascript
//The call - this would cause an error
fooFunction(); 

//The expression
var foo = function fooFunction() {
  console.log('foo');
}
```

## Practice

Practice writing 3 different function expressions of your own choosing.
