IT:AD:JScript/Glossary
Glossary
Class
There is no class keyword in Javascript – you just use a function to create a named object, and add methods to the object's prototype:
var myClassDefinition = function() {
this.myField = "A field that belongs to this object/class".
}
//Add methods to the object:
myClassDefinition.prototype.myFunction = function() {return "X:" + this.myField;}
//Instantiate the method:
var myInstance = new myClassDefinition();
//Invoke the method of the instance:
alert (myInstance.myFunction());
Map
A term used for a field-only object, with no methods/behaviour. Usually created on the fly as a argument message/package, to pass around:
var args = {url : 'whatever', method: 'GET'}
//invoke a method
someService.someMethod(args);