What is Arrow Function and when to use?

Asked

Viewed 1,259 times

2

I’m having a question, I’m studying ES6 but I don’t really understand what the Arrow Function replaces, I researched and I saw that it’s the function this. I would like to know better with an example without and with Arrow Function, and know how the code looks.

I wonder if someone could help me with this ?

  • Is using TypeScript?

  • Arrow Function translating into English are Functions of Arrows It is only a means of writing functions in a more compact way.

  • Example in Typescript: The function Let func = Function (name:string): string { Return My name is: ${name} }. Translated into Arrow Function: Let func = (name:string) => My name is: ${name}

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.