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.

Leave a Reply

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