This page is a work in progress.
FnService - Function Service
...
Name | Summary |
---|---|
isF | Checks if argument is a function. |
isA | Checks if argument is an array. |
isS | Checks if argument is a string. |
isO | Checks if argument is an object. |
contains | Checks if an array contains a value. |
areFunctions | Checks if given strings are names of functions on an API and whether the API has functions that are not listed. |
areFunctionsNonStrict | Checks if given strings are names of functions on an API. (Doesn't care about unlisted functions.) |
windowSize | Returns inner dimensions of the window minus given values. |
isMobile | Returns true if the device viewing the GUI is a mobile device. |
debugOn | Returns true if the debug flag is turned on in query params. |
find | Searches through an array of objects looking for the object with the tagged property with a given key and a specific property name and property value and returns its index. |
inArray | Finds an item's index in the array. |
removeFromArray | Removes the first occurrence of the specified item from the array. |
isEmptyObject | Returns true if the object is empty (has no non-default properties). |
cap | Returns the given string with only the first letter capitalized. |
noPx | Return the argument without the 'px' suffix. |
noPxStyle | Return the element's style property without the 'px' suffix. |
endsWith | Checks if the given string ends with a given suffix. |
parseBitRate | Returns a Number version of the given string bit rate. |
...
Searches through an array of objects looking for the object with the tagged property with a given key a specific property name (tag) and property value (key) and returns its index.
Example Usage | Arguments | Default Params | Return Values |
---|---|---|---|
fs.find(key , array , tag ); |
| tag : 'id' | the index of the object in the array, if found (the index may be 0 – not truthy!) -1 if it wasn't found |
Note: this function searches for a specific name-value pair in an object, as in:
'tag': 'key'
'tag' defaults to 'id' for searching through objects because 'id' is usually unique.
inArray
Finds an item's index in the array.
...