> For the complete documentation index, see [llms.txt](https://haonm.gitbook.io/react-the-complete-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://haonm.gitbook.io/react-the-complete-guide/arrow-functions.md).

# Arrow Functions

### Arrow function là gì <a href="#arrow-function-la-gi-1" id="arrow-function-la-gi-1"></a>

Arrow function - còn được gọi là "fat arrow", là cú pháp được mượn từ CoffeeScript (một ngôn ngữ chuyển tiếp), cú pháp này là cách ngắn gọn hơn dùng để viết function. Ở đây sử dụng kí tự `=>`, trông giống như một mũi tên "béo". Arrow function là một hàm vô danh và nó thay đổi cách `this` bind đến function. Arrow function làm code của ta trông ngắn gọn hơn, giúp đơn giản hóa function scoping cũng như từ khóa `this`. Arrow function hoạt động tương tự như `Lambdas` trong các ngôn ngữ khác như C # hay Python. Bằng cách sử dụng arrow function, chúng ta tránh được việc phải gõ từ khoá `function`, `return` và dấu ngoặc nhọn.

### Cách dùng arrow function <a href="#cach-dung-arrow-function-2" id="cach-dung-arrow-function-2"></a>

Có khá nhiều cú pháp có thể dùng với arrow function. [EcmaScript.org](http://wiki.ecmascript.org/doku.php?id=harmony:arrow_function_syntax), [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) có liệt kê một danh sách đầy đủ các cú pháp có thể được dùng. Ở đây tôi sẽ đề cập đến những cú pháp phổ biến nhất.<br>


---

# 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 dynamically by asking a question.

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

```
GET https://haonm.gitbook.io/react-the-complete-guide/arrow-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.
