Core Description
Function firstKey
mixed firstKey(object|array a_object)
Returns a key of the first element in the a_object argument
Source file
fcf:fcf.js
Namespace
fcf
Arguments:
object|array a_object - A object or array for which a key is obtained
Return value:
mixed
A key of the first element in the a_object argument
Examples
Example 1
var key = fcf.firstKey({first: "firstValue", second: "secondValue"});
console.log(key);
Result:
first
Example 2
var key = fcf.firstKey(["firstValue", "secondValue"]);
console.log(key);
Result:
0