# Arrow Functions

**URL:** <https://forum.codewithmosh.com/t/arrow-functions/4050>\
**Category:** React Native\
**Created:** [April 11, 2021, 4:01pm UTC](https://forum.codewithmosh.com/t/arrow-functions/4050 "2021-04-11T16:01:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksinghcodes](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@ksinghcodes](https://forum.codewithmosh.com/u/ksinghcodes)\
**Post date:** [April 11, 2021, 4:01pm UTC](https://forum.codewithmosh.com/t/arrow-functions/4050/1 "2021-04-11T16:01:39Z")

</div>

Can someone explain to me the purposes of arrow functions . I kind of understand it as replacing this.props ? I dont understand yet why and when I am supposed to use arrow functions.  
Additionally how do I know if im using an empty set of parenthesis or a variable ex - () =\> … or message =\> …

---

<div class="post-metadata">

**Author:** ![dpickut](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@dpickut](https://forum.codewithmosh.com/u/dpickut)\
**Post date:** [April 12, 2021, 5:47pm UTC](https://forum.codewithmosh.com/t/arrow-functions/4050/2 "2021-04-12T17:47:11Z")

</div>

This is a pretty good overview on arrow functions syntax:

> **[A Gentle Introduction to JavaScript Arrow Function](https://www.javascripttutorial.net/es6/javascript-arrow-function/)**
>
> This tutorial shows you how to use JavaScript arrow function syntax in ES6 and provides you with some pitfalls of using arrow functions.

Hope it helps you.

---

<div class="post-metadata">

**Author:** ![ilealm](https://avatars.discourse-cdn.com/v4/letter/i/258eb7/32.png) [@ilealm](https://forum.codewithmosh.com/u/ilealm)\
**Post date:** [April 12, 2021, 11:44pm UTC](https://forum.codewithmosh.com/t/arrow-functions/4050/3 "2021-04-12T23:44:42Z")

</div>

Basically is to type less and have more clean code. Arrow functions can do the same as a normal function, but the code becomes more readable and less verbose.

---

<div class="post-metadata">

**Author:** ![jcdev](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/jcdev/32/215_2.png) [@jcdev](https://forum.codewithmosh.com/u/jcdev)\
**Post date:** [April 15, 2021, 6:22pm UTC](https://forum.codewithmosh.com/t/arrow-functions/4050/5 "2021-04-15T18:22:26Z")

</div>

Additionally you can use arrow function pretty much everywhere instead of class or basic function. You will just have to use hooks instead of the classic React lifecycle.

---

<div class="post-metadata">

**Author:** ![jufriazzq](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jufriazzq](https://forum.codewithmosh.com/u/jufriazzq)\
**Post date:** [April 16, 2021, 3:31am UTC](https://forum.codewithmosh.com/t/arrow-functions/4050/6 "2021-04-16T03:31:20Z")

</div>

- Arrow functions are not hoisted
- They bind `this` to a particular value no matter what
- Cleaner and shorter syntax.
