Home Reference Source

Function

Static Public Summary
public

approx(num: Numeric, decimals: Numeric): Numeric

Used to approximate a number to a certain number of decimals

public

extend(o1: Object, o2: Object): Object

Extends an object with another object

public

html(text: String): HTMLElement

Convert string to html

public

isNumber(value: mixed): Boolean

Checks if the value is a number

public

isObject(o: mixed): Boolean

Checks if the object is an Object

public

loop(collection: Object | Array, cb: Function): *

Loop through a collection Object or Array.

public

radians(angle: Numeric): Numeric

Convert an angle from degrees to radians

public

rnd(min: Number, max: Number): Number

Generate a random number between two values

public

uid(): String

Generates a random unique identifier

Static Public

public approx(num: Numeric, decimals: Numeric): Numeric source

Used to approximate a number to a certain number of decimals

Params:

NameTypeAttributeDescription
num Numeric

The number to be approximated

decimals Numeric

The number of decimals to approximate to

Return:

Numeric

A new number

public extend(o1: Object, o2: Object): Object source

Extends an object with another object

Params:

NameTypeAttributeDescription
o1 Object

The object to be extended

o2 Object

The object to extend with

Return:

Object

Returns the source object

public html(text: String): HTMLElement source

Convert string to html

Params:

NameTypeAttributeDescription
text String

HTML code represented as String

Return:

HTMLElement

public isNumber(value: mixed): Boolean source

Checks if the value is a number

Params:

NameTypeAttributeDescription
value mixed

The value to be checked if it's a number

Return:

Boolean

Returns true if value is a number

public isObject(o: mixed): Boolean source

Checks if the object is an Object

Params:

NameTypeAttributeDescription
o mixed

The value to be checked if its an Object

Return:

Boolean

Returns true if the value is an Object

public loop(collection: Object | Array, cb: Function): * source

Loop through a collection Object or Array. If the function returns a value other then undefined, the loop stops.

Params:

NameTypeAttributeDescription
collection Object | Array

The collection to loop through

cb Function

The callback which is called for every element in collection

Return:

*

If a value other than undefined is returned in the callback, it will be passed on to the return of the function and stop the loop

public radians(angle: Numeric): Numeric source

Convert an angle from degrees to radians

Params:

NameTypeAttributeDescription
angle Numeric

The angle in degrees

Return:

Numeric

The angle in radians

public rnd(min: Number, max: Number): Number source

Generate a random number between two values

Params:

NameTypeAttributeDescription
min Number

The minimum value

max Number

The maximum value

Return:

Number

The random number generated

public uid(): String source

Generates a random unique identifier

Return:

String

A random unique identifier