A collection of generic Javascript functions that help in day to day programming.
Check if a variable|array|object|etc is empty|null|undefined|etc. A full list of what this function considers to be null can be seen in the tests of the Helping project.
Name | Type | Description | |
---|---|---|---|
value |
boolean
A boolean that states if the parsed in value is considered empty.
Iterate over an Object|Array and return the key and value of each property.
This was developed to overcome some of the shortcomings of other methods: https://codepen.io/SeanBannister/pen/qOoLrm
This code is a modified version of jQuery 3.5.0's $.each
Name | Type | Description | |
---|---|---|---|
obj |
Object
Array
|
An object we'll iterate over. |
|
callback |
function(number|string, *)
|
Returns a key (index) and a value. |
Void