node.js series: 3 ways to write JavaScript Functions!

There are 3 basic ways in which you can write your JavaScript Functions.

Simple Way – A function with a name

func1

Declaring function as an object

func.PNG

Create functions dynamically by Calling the constructor

func3.PNG

Summing it up:

func4

Output after execution:

func5.PNG

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s