Skip to content

Function_evisit_core_js_utils_firstOf

Taylor Everding edited this page Feb 9, 2021 · 1 revision

function firstOf(value[, defaultValue])

Parameters

  • value
    • (Array|String) Array or String to get element from
  • defaultValue [optional]
    • (*) Specify a default value to return if provided value is not an instance of Array or String, or element is null or undefined

Return value

  • (*) first element of array / string, undefined if does not exist.

Description

returns the first element of provided Array or String. If the param is not an instance of Array or String, defaultValue is returned.

See Also


Clone this wiki locally