Interesting things about JavaScript

1. If we assign value to an object’s property that doesn’t exist, then it the object itself will be augmented and property will be added

ex.:  stooge[‘first-name’] = ‘Jerome’;

2.  Functions can be passed as arguments to functions, and functions can be returned from functions. Also, since functions are objects, functions can have methods.

3.  An inner function also enjoys access to the parameters and variables of the functions it is nested within.

4.  In addition to the declared parameters, every function receives two additional parameters: this and arguments

5.  A function always returns a value. If the return value is not specified, then undefined
is returned

 

Function Invocation:

There are four patterns of invocation in JavaScript: the method invocation pattern, the function invocation pattern, the constructor invocation pattern, and the apply invocation pattern. The patterns differ in how the bonus parameter this is initialized.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s