-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This repository is part of a larger project!
Functions, methods and constructors are in Javascript different variations of one common thing and that is function. These three function patterns can be called in a visible distinct way:
function simpleFunction()
{
alert("Hello world");
}
//Call
simpleFunction();
var simpleObject =
{
method: function()
{
alert("Hello world");
}
}
//Call
simpleObject.method();
function simpleConstructor(anyArgument)
{
this.attribute = anyArgument;
}
//Using the 'new' operator treats it as a constructor
var anyObject = new simpleConstructor("Hello world");
//Call
simpleObject.attribute();
The user interaction part should look like the content as seen below by starting "index.html" in a web browser.
The colored areas are just for a better readability in the wiki and are not part of the content. To use the project just download the files and execute "index.html". Note that all files should be placed in the same folder so that the functionality of the code is guaranteed.
This knowledge was gained:
-
Effective JavaScript "68 Specific Ways to Harness the Power of JavaScript" by David Herman
-
Jokes found in differences.js were taken from short-funny.com