Format of a Library Script

A library script contains functions and properties. The authorized librarian or developer can specify the functions and properties to be invoked when a library script is used.

Examples

 

How to expose a method

function method() {

    // implementation

}

 

return method;

 

How to expose methods and properties

function method() {

    // implementation

}

var property = 1;

 

return {

    method: method,

    property: property

};