Function
Static Public Summary | ||
public |
approx(num: Numeric, decimals: Numeric): Numeric Used to approximate a number to a certain number of decimals |
|
public |
Extends an object with another object |
|
public |
Convert string to html |
|
public |
Checks if the value is a number |
|
public |
Checks if the object is an Object |
|
public |
Loop through a collection Object or Array. |
|
public |
radians(angle: Numeric): Numeric Convert an angle from degrees to radians |
|
public |
Generate a random number between two values |
|
public |
Generates a random unique identifier |
Static Public
public approx(num: Numeric, decimals: Numeric): Numeric source
import {approx} from '@crispcode/modux/scripts/utils/approx.js'
Used to approximate a number to a certain number of decimals
Params:
Name | Type | Attribute | Description |
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
import {extend} from '@crispcode/modux/scripts/utils/extend.js'
Extends an object with another object
public html(text: String): HTMLElement source
import {html} from '@crispcode/modux/scripts/utils/html.js'
Convert string to html
Params:
Name | Type | Attribute | Description |
text | String | HTML code represented as String |
Return:
HTMLElement |
public isNumber(value: mixed): Boolean source
import {isNumber} from '@crispcode/modux/scripts/utils/isnumber.js'
Checks if the value is a number
Params:
Name | Type | Attribute | Description |
value | mixed | The value to be checked if it's a number |
public isObject(o: mixed): Boolean source
import {isObject} from '@crispcode/modux/scripts/utils/isobject.js'
Checks if the object is an Object
Params:
Name | Type | Attribute | Description |
o | mixed | The value to be checked if its an Object |
public loop(collection: Object | Array, cb: Function): * source
import {loop} from '@crispcode/modux/scripts/utils/loop.js'
Loop through a collection Object or Array. If the function returns a value other then undefined, the loop stops.
Return:
* | If a value other than |
public radians(angle: Numeric): Numeric source
import {radians} from '@crispcode/modux/scripts/utils/radians.js'
Convert an angle from degrees to radians
Params:
Name | Type | Attribute | Description |
angle | Numeric | The angle in degrees |
Return:
Numeric | The angle in radians |
public rnd(min: Number, max: Number): Number source
import {rnd} from '@crispcode/modux/scripts/utils/rnd.js'
Generate a random number between two values
public uid(): String source
import {uid} from '@crispcode/modux/scripts/utils/uid.js'
Generates a random unique identifier