Arrays
defaultAttributes
Use a default array and pass in overriding keys if there is a key from the attributes array in the defaults array.
Example
Replace key from defaults with one found in the attributes:
Key from attributes was not found in defaults so the defaults will be returned:
getAttribute
Get an value from array by key. If none was found use a default.
Example
Get value from array by key:
A default value value is returned if key is not found:
getKey
Get an key from array by value. if none was found use a default.
Example
Get a key from array by value:
A default key value is returned if value is not found: