Members
Methods
# def(val, defaultVal) → {object}
Assigns a default value to a var if it's undefined.
Parameters:
Name | Type | Description |
---|---|---|
val |
object
|
The variable to set |
defaultVal |
object
|
The default value |
The var
object
Example
foo = def( foo, 12 ); // if foo was undefined, it is now 12, else it's unchanged.
# isdef(val) → {boolean}
Checks if a value is defined. Convenience replacement for `typeof val !== 'undefined`
Parameters:
Name | Type | Description |
---|---|---|
val |
any
|
The value |
boolean
# jstype(exp) → {string}
Improved typeof which returns the type of object instead of 'object'
Parameters:
Name | Type | Description |
---|---|---|
exp |
any
|
The expression to check. |
The type always in lower case.
string
# seedRandom() → {int}
Adds a new Math.seedRandom() method, used as a workaround for a bug in Math.random() with After Effects on Mac OS
- Copyright:
- David Bau
- License:
- MIT
int