Converting a traditional function method to an arrow function method

Jesus Nieves
Jan 27, 2022

--

We are going to do it in three simple steps that we can apply in all our functions.

Let’s take as a starting point the following function that returns a greeting to our dear user;

Let’s start breaking down the function;

First step

We change the word function to const.

Second step

We add the equals sign = between the function name and the argument.

Third and last step

Now we add the mighty arrow, we do this between the argument and the opening bracket.

Done, we have converted our old traditional function into an arrow function.

If you want to know everything about arrow functions, take a look at this article.

Thanks for going through this quick guide.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Jesus Nieves
Jesus Nieves

Written by Jesus Nieves

✖Member of the @xteam, 👊🏽Software Engineer at @riotgames 👨🏽‍🏫Mentor at @FrontEndCafe 📢Speaker at @fundacionjaa ✍🏼Writer at @medium

No responses yet

Write a response