Function Declarations vs. Function Expressions

Function Declarations

Function Declarations are normal function we write!

See an example –

day5-1

Function Expressions

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

See an example –

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 function easily inside of a expression.

Finally see both example at once –

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

Leave a Reply

Your email address will not be published. Required fields are marked *