DEV Community

Cover image for Day 5 - Function Declarations vs. Function Expressions - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb)
Muhammad Ali (Nerdjfpb)

Posted on • Edited on • Originally published at blog.nerdjfpb.com

Day 5 - Function Declarations vs. Function Expressions - Learning Node JS In 30 Days [Mini series]

Today's topic is Function Declarations vs. Function Expressions. You can find a graphical view on instagram -

Function Declarations

Function Declarations are normal function we write!

See an example--

Alt Text

Function Expressions

The function keyword can be used to define a function inside an expression.

See an example--

Alt Text

You must ask this in mind Why this is important ?

Because this pattern is used widely in JavaScript, this will help you to understand and write small functions easily inside of a expression.

Finally see both example at once –-

Alt Text

Comment out if you have any question & are you enjoying this series ?

Originally it published on nerdjfpbblog. You can connect with me in twitter or linkedin !

Top comments (0)