# Functions

* Programs are assigning the values to the memory or variables and running the program to do somethings with the variables.
* without functions programs can't do anything.

Function Expression:

```javascript
var canada = function() {
    console.log("cold");
}
```

Function Declaration:

```javascript
function india() {
    console.log("warm");
}
```

Function Invocation/Call/Execution:

```javascript
canada(); // defined at run time that what this function does
india();  // defined at parse time - hoisting
```

* Function invocation will create an Execution context that gives an this (=window) and arguments object.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://javascript-1.gitbook.io/javascript/functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
