> For the complete documentation index, see [llms.txt](https://program.hackyourfuture.dk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://program.hackyourfuture.dk/course-content/frontend/advanced-javascript/week1.md).

# 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](https://program.hackyourfuture.dk/course-content/frontend/advanced-javascript/week1/preparation.md)
* [Session Plan](https://program.hackyourfuture.dk/course-content/frontend/advanced-javascript/week1/session-plan.md) (for mentors)
* [Assignment](https://program.hackyourfuture.dk/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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://program.hackyourfuture.dk/course-content/frontend/advanced-javascript/week1.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
