Child pages
  • Function

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Hidden
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE


HTML Table
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Function
Table Cell (td)
#constructor
Specifies the function that creates an object's prototype.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#length
Specifies the number of arguments expected by the function.

HTML Table
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#apply()
Applies the method of another object in the context of a different object (the calling object); arguments can be passed as an Array object.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#bind()
Creates a new function which, when called, itself calls this function in the context of the provided value, with a given sequence of arguments preceding any provided when the new function was called.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#call()
Calls (executes) a method of another object in the context of a different object (the calling object); arguments can be passed as they are.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#toString()
Returns a string representing the source code of the function.

HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Property Details
Table Body (tbody)
idconstructor
classnode
Table Row (tr)
idname
Table Cell (td)
constructor
Table Row (tr)
iddes
Table Cell (td)
Specifies the function that creates an object's prototype.
Table Row (tr)
idret
Table Cell (td)
Returns
Function
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
function Tree(name) {
	this.name = name;
}
theTree = new Tree("Redwood");
application.output("theTree.constructor is " + theTree.constructor);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idlength
classnode
Table Row (tr)
idname
Table Cell (td)
length
Table Row (tr)
iddes
Table Cell (td)
Specifies the number of arguments expected by the function.
Table Row (tr)
idret
Table Cell (td)
Returns
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
function addNumbers(x, y){
	if (addNumbers.length == 2) {
		return (x + y);
	} else
		return 0;
}
Table Row (tr)
classlastDetailRow
Table Cell (td)


HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idapply
classnode
Table Row (tr)
idname
Table Cell (td)
apply
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
apply
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Applies the method of another object in the context of a different object (the calling object); arguments can be passed as an Array object.
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
function book(name, author) {
	this.name = name;
	this.author = author;
}

function book_with_topic(name, author, topic) {
	this.topic = topic;
	book.apply(this, arguments);
}
book_with_topic.prototype = new book();

var aBook = new book_with_topic("name","author","topic");
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idbind
classnode
Table Row (tr)
idname
Table Cell (td)
bind
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
bind
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Creates a new function which, when called, itself calls this function in the context of the provided value, with a given sequence of arguments preceding any provided when the new function was called.
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var x = 9,
	module = {
		getX: function() {
		     return this.x;
		},
		x: 81
	};
//  "module.getX()" called, "module" is "this", "module.x" is returned
module.getX(); // > 81
//  "getX()" called, "this" is global, "x" is returned
getX(); // > 9
//  store a reference with "module" bound as "this"
var boundGetX = getX.bind(module);
//  "boundGetX()" called, "module" is "this" again, "module.x" is returned
boundGetX(); // > 81
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcall
classnode
Table Row (tr)
idname
Table Cell (td)
call
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
call
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Calls (executes) a method of another object in the context of a different object (the calling object); arguments can be passed as they are.
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
function book(name) {
	this.name = name;
}

function book_with_author(name, author) {
	this.author = author;
	book.call(this, name);
}
book_with_author.prototype = new book();

var aBook = new book_with_author("name","author");
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idtoString
classnode
Table Row (tr)
idname
Table Cell (td)
toString
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String
Span
stylefloat: left; font-weight: bold;
idiets
toString
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Returns a string representing the source code of the function. Overrides the Object.toString method.
Table Row (tr)
idret
Table Cell (td)
Returns
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
function printHello() {
		return "Hello";
}
application.output(printHello.toString());
Table Row (tr)
classlastDetailRow
Table Cell (td)