Javascript Functions

  •  Are first-class objects.
  • As a result, can be assigned to variables, can be given as arguments.
  • Can be declared by name of by using function expression.
  • () operator executes the function.
  • All functions have a default property named “parameters”. It is an “array-like” object where all given parameters can be reached.
  • Parameters are passed by value. Objects values has still refers to the same object !
  • Function footprint exists only from name. Parameters are not included in de name. As a result, function overloading is not possible.
  • It is not possible to have several functions with the same name and different amount of arguments.
  • All function parameters are optional, also declared parameters. Not supplied parameters gets the value “undefined”. Undeclared parameters can’t be reached with a name but well through “arguments” property.
  • Default return value is undefined.

 

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