Javascript

Javascript was previously known as Livescript. Its amazing what a simple name change can do for the image of a mundane customisation language.


Object Model

Classes in javascript are like an empty orange that gets filled with fruity segments.

Javascript is a lightweight language with limited capabilities and use. It does not appear to need the object oriented facilities of its bigger brother Java

First write the methods

	function mymethodg1, arg2,arg3,arg4,...)

	{

		...

	}

The method has no idea on which object it is being defined, its just a bit of behaviour that can be assigned to any class.

then the object

	function the_object( arg1, arg2,arg3,arg4,...)

	{

		this.property1 = arg1

		this.property2 = arg2

		this.property3 = arg3

		this.property4 = arg4

		this.method1 = mymethod

	}

names of properties and methods are not declared in advance. This can make it difficult when re-using code to figure out just what is available. Fortunately Javascript is not intended for massive applications, just small vlidation programs.

and use it

my_object = the_object.new("22",1,34)

my_object.mymethod()

Thats about it!