Global

Members

body

window.document.body
Source:

doc

window.document
Source:

Methods

addDefault(target) → {Object}

Copies values from one or more source objects to a target object
Parameters:
Name Type Attributes Description
target Object
Object <repeatable>
Source:
Returns:
Object

addUnique(arr, item) → {Array}

Adds an item to the array if the array doesn't contains it
Parameters:
Name Type Description
arr Array
item *
Source:
Returns:
Array

applyEach(arr, callback) → {Array}

Executes a provided callback function once per array element with the given arguments, sets it's this value to the currentValue
Parameters:
Name Type Attributes Description
arr Array
callback function
* <repeatable>
Source:
Returns:
Array

assign(target) → {Object}

Copies the values of all enumerable own properties from one or more source objects to a target object
Parameters:
Name Type Attributes Description
target Object
Object <repeatable>
Source:
Returns:
Object

between(n, min, max) → {Boolean}

Checks if the given number is between the given min and max values
Parameters:
Name Type Description
n Number
min Number
max Number
Source:
Returns:
Boolean

callEach(arr, callback) → {Array}

Executes a provided callback function once per array element, and sets it's this value to the currentValue
Parameters:
Name Type Description
arr Array
callback function
Source:
Returns:
Array

capitalize(text) → {String}

Capitalizes a given string
Parameters:
Name Type Description
text String
Source:
Returns:
String

clone(obj) → {Object}

Clones an object
Parameters:
Name Type Description
obj Object
Source:
Returns:
Object

count(arr, searchItem) → {int}

Counts how many times an item exists in an array
Parameters:
Name Type Description
arr Array
searchItem *
Source:
Returns:
int

createArray(length, fillValue) → {Array}

Creates a new array
Parameters:
Name Type Description
length int
fillValue *
Source:
Returns:
Array

createElement(tagName, parentElementopt, textContentopt) → {HTMLElement}

Creates an HTML element
Parameters:
Name Type Attributes Description
tagName String
parentElement HTMLElement <optional>
textContent String <optional>
Source:
Returns:
HTMLElement

debug(obj, message) → {undefined}

Outputs an object to the Web Console
Parameters:
Name Type Description
obj *
message String
Source:
Returns:
undefined

deg2rad(deg) → {Number}

Converts degree to radian
Parameters:
Name Type Description
deg Number
Source:
Returns:
Number

die(message)

Throws an error
Parameters:
Name Type Description
message String
Source:
Throws:
Error

empty(arr) → {Array}

Empties an array
Parameters:
Name Type Description
arr Array
Source:
Returns:
Array
arr

endsWith(str, searchString) → {Boolean}

Determines whether a string ends with the characters of another string
Parameters:
Name Type Description
str String
searchString String
Source:
Returns:
Boolean

error(message) → {undefined}

Outputs an error to the Web Console
Parameters:
Name Type Description
message String
Source:
Returns:
undefined

execute(arr, callback, thisArgopt) → {Array}

Executes a provided callback function once per array element, returns a value
Parameters:
Name Type Attributes Description
arr Array
callback function
thisArg Object <optional>
Source:
Returns:
Array

fillArray(arr, fillValue) → {Array}

Fills an array
Parameters:
Name Type Description
arr Array
fillValue *
Source:
Returns:
Array

findFirstRegX(regX, str) → (nullable) {String}

Returns the first match of the regex in the given string or null
Parameters:
Name Type Description
regX RegExp
str String
Source:
Returns:
String

first(arr) → {*}

Returns the first item of an array
Parameters:
Name Type Description
arr Array
Source:
Returns:
*

forEach(arr, callback, thisArgopt) → {Array}

Executes a provided callback function once per array element
Parameters:
Name Type Attributes Description
arr Array
callback function
thisArg Object <optional>
Source:
Returns:
Array

forIn(obj, callback, thisArgopt) → {Object}

Iterates over the enumerable properties of an object
Parameters:
Name Type Attributes Description
obj Object
callback function
thisArg Object <optional>
Source:
Returns:
Object

generateUUID() → {String}

Generates a UUID
Source:
See:
Returns:
String

getArgs(args, beginopt, endopt) → {Array}

Converts arguments to Array
Parameters:
Name Type Attributes Default Description
args Arguments
begin int <optional>
0
end int <optional>
args.length - 1
Source:
Returns:
Array

getFloat(str) → {Number}

Parses a string and returns a float
Parameters:
Name Type Description
str String
Source:
Returns:
Number

getInt(str) → {int}

Parses a string and returns an integer
Parameters:
Name Type Description
str String
Source:
Returns:
int

getPreferredAudioType() → (nullable) {String}

Gets the preferred audio type
Source:
Returns:
String

getProps(obj, properties) → {Object}

Returns an object with the given properties with the source's values
Parameters:
Name Type Description
obj Object
properties Array
Source:
Returns:
Object

has(obj, key) → {Boolean}

Returns a boolean indicating whether an object has the specified property
Parameters:
Name Type Description
obj Object
key String
Source:
Returns:
Boolean

ifBrowserSupportAudio() → {Boolean}

Checks if the browser support audios
Source:
Returns:
Boolean

inArray(arr, searchItem) → {Boolean}

Checks if an item exists in an array
Parameters:
Name Type Description
arr Array
searchItem *
Source:
Returns:
Boolean

inherit(constructor) → (nullable) {Object}

Creates a new object inherits from the given constructor
Parameters:
Name Type Description
constructor function
Source:
Returns:
Object

is(o1, o2) → {Boolean}

Determines whether an object is instance of another object
Parameters:
Name Type Description
o1 Object
o2 Object
Source:
Returns:
Boolean

isArray(testValue) → {Boolean}

Determines whether a value is Array or not
Parameters:
Name Type Description
testValue *
Source:
Returns:
Boolean

isBoolean(testValue) → {Boolean}

Determines whether a value is Boolean or not
Parameters:
Name Type Description
testValue *
Source:
Returns:
Boolean

isFunction(testValue) → {Boolean}

Determines whether a value is Function or not
Parameters:
Name Type Description
testValue *
Source:
Returns:
Boolean

isNaN(testValue) → {Boolean}

Determines whether a value is NaN or not
Parameters:
Name Type Description
testValue *
Source:
Returns:
Boolean

isNull(testValue) → {Boolean}

Determines whether a value is null or not
Parameters:
Name Type Description
testValue *
Source:
Returns:
Boolean

isNullOrUndefined(testValue) → {Boolean}

Determines whether a value is null or undefined
Parameters:
Name Type Description
testValue *
Source:
Returns:
Boolean

isNumber(testValue) → {Boolean}

Determines whether a value is Number or not
Parameters:
Name Type Description
testValue *
Source:
Returns:
Boolean

isObject(testValue) → {Boolean}

Determines whether a value is Object or not
Parameters:
Name Type Description
testValue *
Source:
Returns:
Boolean

isPercent(val) → {Boolean}

Determines if a given value is percent
Parameters:
Name Type Description
val String
Source:
Returns:
Boolean

isString(testValue) → {Boolean}

Determines whether a value is String or not
Parameters:
Name Type Description
testValue *
Source:
Returns:
Boolean

isUndefined(testValue) → {Boolean}

Determines whether a value is undefined or not
Parameters:
Name Type Description
testValue *
Source:
Returns:
Boolean

keys(obj) → {Array}

Returns an array of a given object's own enumerable properties
Parameters:
Name Type Description
obj Object
Source:
Returns:
Array

last(arr) → {*}

Returns the last item of an array
Parameters:
Name Type Description
arr Array
Source:
Returns:
*

log() → {undefined}

Outputs a message to the Web Console
Parameters:
Type Attributes Description
String <repeatable>
Source:
Returns:
undefined

parseMethod(method, thisArgopt, argsopt) → {function}

Creates a new function
Parameters:
Name Type Attributes Description
method String
thisArg Object <optional>
args Array <optional>
Source:
To Do:
  • Replace "@" character globally (if not string) to "this."
Returns:
function

parsePercent(val, relative) → {Number}

Parse a parcentage to number
Parameters:
Name Type Description
val String
relative Number
Source:
Returns:
Number

playAudio(audio, volumeopt, resetopt, callbackopt) → {Audio}

Plays an audio
Parameters:
Name Type Attributes Description
audio Audio
volume int <optional>
reset Boolean <optional>
callback function <optional>
Source:
Returns:
Audio

preventDefault(e) → {Boolean}

Cancels the event if it is cancelable, without stopping further propagation of the event
Parameters:
Name Type Description
e Event
Source:
Returns:
Boolean
false

rand(min, max) → {int}

Generates a number between two values
Parameters:
Name Type Description
min int
max int
Source:
Returns:
int

range(min, max, n) → {Number}

Returns a number in a range
Parameters:
Name Type Description
min Number
max Number
n Number
Source:
Returns:
Number

remove(arr, removeItem, limitopt) → {int}

Removes item(s) from an array
Parameters:
Name Type Attributes Default Description
arr Array
removeItem *
limit int <optional>
1
Source:
Returns:
int
removedCount

repeat(n, callback, thisArgopt) → {*}

Repeats the given function n times
Parameters:
Name Type Attributes Description
n int
callback function
thisArg Object <optional>
Source:
Returns:
*
thisArg

repeatChar(s, n) → {String}

Repeats a string n times
Parameters:
Name Type Description
s String
n int
Source:
Returns:
String

startsWith(str, searchString) → {Boolean}

Determines whether a string begins with the characters of another string
Parameters:
Name Type Description
str String
searchString String
Source:
Returns:
Boolean

stdClass() → {Object}

Creates a new empty object, and returns it
Source:
Returns:
Object

stopPropagation(e) → {Boolean}

Prevents further propagation of the current event
Parameters:
Name Type Description
e Event
Source:
Returns:
Boolean
false

toArray(item) → {Array}

Returns array
Parameters:
Name Type Description
item *
Source:
Returns:
Array

use(target, data) → {Object}

Modifies an object by complex rules
Parameters:
Name Type Description
target Object
data Object
Source:
Returns:
Object
target

values(obj) → {Array}

Returns an array of a given object's own enumerable values
Parameters:
Name Type Description
obj Object
Source:
Returns:
Array

warning(message) → {undefined}

Outputs a warning to the Web Console
Parameters:
Name Type Description
message String
Source:
Returns:
undefined