# Week 1

This session is about mastering the most commonly used array functions provided by Javascript. Working with arrays is an essential part of being a javascript developer. A lot of the time js developers have an array of some objects. That could be **users**, **products**, **posts**, **jobs** etc. Developers so often need to filter the arrays, change the structure of the array, sort them or loop through them.

Understanding how to use array functions and the arrow notation can greatly improve the readability of your code.

The module strongly encourages going beyond JavaScript alone and **implementing a real frontend**—work that runs in the browser with a visible, interactive UI. All exercises (session materials and assignment) are designed so that JavaScript drives HTML and the interface.

## Contents

* [Preparation](/course-content/frontend/advanced-javascript/week1/preparation.md)
* [Session Plan](/course-content/frontend/advanced-javascript/week1/session-plan.md) (for mentors)
* [Assignment](/course-content/frontend/advanced-javascript/week1/assignment.md)

## Session Learning Goals

By the end of this session, you will be able to:

* [ ] Use the **arrow function syntax** with any number of arguments
* [ ] Use the **arrow function syntax** with an implicit return (no curly braces)
* [ ] Use the **array functions** `.forEach()`, `.map()`, and `.filter()`
* [ ] Know how to find and learn about other **array functions** such as `.find()`, `.some()`, `.reduce()`
* [ ] Combine multiple **array functions** (chaining) to solve complex problems in a concise way.

```js
// Example of using filter() with an arrow function
const expensiveItems = myItemArray.filter((x) => x.cost > 200);
```


---

# 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://program.hackyourfuture.dk/course-content/frontend/advanced-javascript/week1.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.
