Child pages
  • Function

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

padding0px
width80px

...

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary

...

Table Cell (td)
Function

...

DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.
Enter additional information related to this 'class' inside the {div} macro with 'id=description'
Divcache
styleindexdisplay:none

...

iddescription

...

true
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientsWordListMobileClient

servoy sSummary12%30%58%height: 30px;3Property SummarySpecifies the function that creates an object's prototype.

...

Table Cell (td)
Number

...

Specifies the number of arguments expected by the function.

...

servoy sSummary

...

padding0px
width80px

...

12%30%58%height: 30px;

...

Table Head (th)
colspan2
Method Summary

...

Table Cell (td)
void

...

3Methods SummaryvoidApplies the method of another object in the context of a different object (the calling object); arguments can be passed as an Array object.

...

void

...

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.

...

void

...

Table Cell (td)
String

...

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
Returns a string representing the source code of the function.

...

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");

...

classlastDetailRow

...

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

...

classlastDetailRow

...

servoy sDetail2Property Detailsconstructornametd

constructor

id

des

sIndent
Specifies the function that creates an object's prototype.
idtd
ret

Returns

divsIndentclients

id

property

class
Colgroup Tag
Column
padding0px
width100%
Table Row (tr)
style2100%height:30px;
Table Head (th)
colspan1
Table Body (tbody)
idid
Table Row (tr)
Table Row (tr)
Table Cell (td)
Div
class
Table Row (tr)
classsIndent
Function
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
function Tree(name) {
	this.name = name;
}
theTree = new Tree("Redwood");
console.log("theTree.constructor is " + theTree.constructor);
Table Row (tr)
classlastDetailRow
Table Cell (td) Table Body (tbody)
idlength
Table Row (tr)
idname
Table Cell (td)
length
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Specifies the number of arguments expected by the function.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
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)

...

idfunction
classservoy sDetail

...

padding0px
width100%
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details

...

idapply
Table Row (tr)
idname
Table Cell (td)
apply
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
apply
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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
Div
classsIndent
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");

...

classlastDetailRow

...

idbind
Table Row (tr)
idname
Table Cell (td)
bind
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
bind
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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
Div
classsIndent
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

...

classlastDetailRow

...

idcall
Table Row (tr)
idname
Table Cell (td)
call
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
call
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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
Div
classsIndent
void

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
lengthname

length

dessIndent
Specifies the number of arguments expected by the function.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow

functionservoy sDetail2100%height:30px2Methods Detailsapplyname

apply()

dessIndent
Applies the method of another object in the context of a different object (the calling object); arguments can be passed as an Array object.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRowbindname

bind()

dessIndent
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.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
callname

call()

dessIndent
Calls (executes) a method of another object in the context of a different object (the calling object); arguments can be passed as they are.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
toStringname

toString()

dessIndent
Returns a string representing the source code of the function. Overrides the Object.toString method.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow