Members
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> |
Returns:
ObjectaddUnique(arr, item) → {Array}
Adds an item to the array if the array doesn't contains it
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array | |
item |
* |
Returns:
ArrayapplyEach(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> |
Returns:
Arrayassign(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> |
Returns:
Objectbetween(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 |
Returns:
BooleancallEach(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 |
Returns:
Arraycapitalize(text) → {String}
Capitalizes a given string
Parameters:
Name | Type | Description |
---|---|---|
text |
String |
Returns:
Stringclone(obj) → {Object}
Clones an object
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object |
Returns:
Objectcount(arr, searchItem) → {int}
Counts how many times an item exists in an array
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array | |
searchItem |
* |
Returns:
intcreateArray(length, fillValue) → {Array}
Creates a new array
Parameters:
Name | Type | Description |
---|---|---|
length |
int | |
fillValue |
* |
Returns:
ArraycreateElement(tagName, parentElementopt, textContentopt) → {HTMLElement}
Creates an HTML element
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tagName |
String | ||
parentElement |
HTMLElement |
<optional> |
|
textContent |
String |
<optional> |
Returns:
HTMLElementdebug(obj, message) → {undefined}
Outputs an object to the Web Console
Parameters:
Name | Type | Description |
---|---|---|
obj |
* | |
message |
String |
Returns:
undefineddeg2rad(deg) → {Number}
Converts degree to radian
Parameters:
Name | Type | Description |
---|---|---|
deg |
Number |
Returns:
Numberdie(message)
Throws an error
Parameters:
Name | Type | Description |
---|---|---|
message |
String |
Throws:
Error
empty(arr) → {Array}
Empties an array
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array |
Returns:
Arrayarr
endsWith(str, searchString) → {Boolean}
Determines whether a string ends with the characters of another string
Parameters:
Name | Type | Description |
---|---|---|
str |
String | |
searchString |
String |
Returns:
Booleanerror(message) → {undefined}
Outputs an error to the Web Console
Parameters:
Name | Type | Description |
---|---|---|
message |
String |
Returns:
undefinedexecute(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> |
Returns:
ArrayfillArray(arr, fillValue) → {Array}
Fills an array
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array | |
fillValue |
* |
Returns:
ArrayfindFirstRegX(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 |
Returns:
Stringfirst(arr) → {*}
Returns the first item of an array
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array |
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> |
Returns:
ArrayforIn(obj, callback, thisArgopt) → {Object}
Iterates over the enumerable properties of an object
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj |
Object | ||
callback |
function | ||
thisArg |
Object |
<optional> |
Returns:
ObjectgenerateUUID() → {String}
Generates a UUID
- Source:
- See:
Returns:
StringgetArgs(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 |
Returns:
ArraygetFloat(str) → {Number}
Parses a string and returns a float
Parameters:
Name | Type | Description |
---|---|---|
str |
String |
Returns:
NumbergetInt(str) → {int}
Parses a string and returns an integer
Parameters:
Name | Type | Description |
---|---|---|
str |
String |
Returns:
intgetPreferredAudioType() → (nullable) {String}
Gets the preferred audio type
Returns:
StringgetProps(obj, properties) → {Object}
Returns an object with the given properties with the source's values
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object | |
properties |
Array |
Returns:
Objecthas(obj, key) → {Boolean}
Returns a boolean indicating whether an object has the specified property
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object | |
key |
String |
Returns:
BooleanifBrowserSupportAudio() → {Boolean}
Checks if the browser support audios
Returns:
BooleaninArray(arr, searchItem) → {Boolean}
Checks if an item exists in an array
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array | |
searchItem |
* |
Returns:
Booleaninherit(constructor) → (nullable) {Object}
Creates a new object inherits from the given constructor
Parameters:
Name | Type | Description |
---|---|---|
constructor |
function |
Returns:
Objectis(o1, o2) → {Boolean}
Determines whether an object is instance of another object
Parameters:
Name | Type | Description |
---|---|---|
o1 |
Object | |
o2 |
Object |
Returns:
BooleanisArray(testValue) → {Boolean}
Determines whether a value is Array or not
Parameters:
Name | Type | Description |
---|---|---|
testValue |
* |
Returns:
BooleanisBoolean(testValue) → {Boolean}
Determines whether a value is Boolean or not
Parameters:
Name | Type | Description |
---|---|---|
testValue |
* |
Returns:
BooleanisFunction(testValue) → {Boolean}
Determines whether a value is Function or not
Parameters:
Name | Type | Description |
---|---|---|
testValue |
* |
Returns:
BooleanisNaN(testValue) → {Boolean}
Determines whether a value is NaN or not
Parameters:
Name | Type | Description |
---|---|---|
testValue |
* |
Returns:
BooleanisNull(testValue) → {Boolean}
Determines whether a value is null or not
Parameters:
Name | Type | Description |
---|---|---|
testValue |
* |
Returns:
BooleanisNullOrUndefined(testValue) → {Boolean}
Determines whether a value is null or undefined
Parameters:
Name | Type | Description |
---|---|---|
testValue |
* |
Returns:
BooleanisNumber(testValue) → {Boolean}
Determines whether a value is Number or not
Parameters:
Name | Type | Description |
---|---|---|
testValue |
* |
Returns:
BooleanisObject(testValue) → {Boolean}
Determines whether a value is Object or not
Parameters:
Name | Type | Description |
---|---|---|
testValue |
* |
Returns:
BooleanisPercent(val) → {Boolean}
Determines if a given value is percent
Parameters:
Name | Type | Description |
---|---|---|
val |
String |
Returns:
BooleanisString(testValue) → {Boolean}
Determines whether a value is String or not
Parameters:
Name | Type | Description |
---|---|---|
testValue |
* |
Returns:
BooleanisUndefined(testValue) → {Boolean}
Determines whether a value is undefined or not
Parameters:
Name | Type | Description |
---|---|---|
testValue |
* |
Returns:
Booleankeys(obj) → {Array}
Returns an array of a given object's own enumerable properties
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object |
Returns:
Arraylast(arr) → {*}
Returns the last item of an array
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array |
Returns:
*log() → {undefined}
Outputs a message to the Web Console
Parameters:
Type | Attributes | Description |
---|---|---|
String |
<repeatable> |
Returns:
undefinedparseMethod(method, thisArgopt, argsopt) → {function}
Creates a new function
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
method |
String | ||
thisArg |
Object |
<optional> |
|
args |
Array |
<optional> |
Returns:
functionparsePercent(val, relative) → {Number}
Parse a parcentage to number
Parameters:
Name | Type | Description |
---|---|---|
val |
String | |
relative |
Number |
Returns:
NumberplayAudio(audio, volumeopt, resetopt, callbackopt) → {Audio}
Plays an audio
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
audio |
Audio | ||
volume |
int |
<optional> |
|
reset |
Boolean |
<optional> |
|
callback |
function |
<optional> |
Returns:
AudiopreventDefault(e) → {Boolean}
Cancels the event if it is cancelable, without stopping further propagation of the event
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
Returns:
Booleanfalse
rand(min, max) → {int}
Generates a number between two values
Parameters:
Name | Type | Description |
---|---|---|
min |
int | |
max |
int |
Returns:
intrange(min, max, n) → {Number}
Returns a number in a range
Parameters:
Name | Type | Description |
---|---|---|
min |
Number | |
max |
Number | |
n |
Number |
Returns:
Numberremove(arr, removeItem, limitopt) → {int}
Removes item(s) from an array
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
arr |
Array | |||
removeItem |
* | |||
limit |
int |
<optional> |
1 |
Returns:
intremovedCount
repeat(n, callback, thisArgopt) → {*}
Repeats the given function n times
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
n |
int | ||
callback |
function | ||
thisArg |
Object |
<optional> |
Returns:
*thisArg
repeatChar(s, n) → {String}
Repeats a string n times
Parameters:
Name | Type | Description |
---|---|---|
s |
String | |
n |
int |
Returns:
StringstartsWith(str, searchString) → {Boolean}
Determines whether a string begins with the characters of another string
Parameters:
Name | Type | Description |
---|---|---|
str |
String | |
searchString |
String |
Returns:
BooleanstdClass() → {Object}
Creates a new empty object, and returns it
Returns:
ObjectstopPropagation(e) → {Boolean}
Prevents further propagation of the current event
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
Returns:
Booleanfalse
toArray(item) → {Array}
Returns array
Parameters:
Name | Type | Description |
---|---|---|
item |
* |
Returns:
Arrayuse(target, data) → {Object}
Modifies an object by complex rules
Parameters:
Name | Type | Description |
---|---|---|
target |
Object | |
data |
Object |
Returns:
Objecttarget
values(obj) → {Array}
Returns an array of a given object's own enumerable values
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object |