UNPKG
@kitmi/utils
Version:
latest (1.3.1)
1.3.1
1.3.0
1.2.3
1.2.2
1.2.1
1.2.0
1.1.3
1.1.2
1.1.1
1.1.0
1.0.0
A JavaScript utility library for both server and browser
github.com/kitmi/jacaranda
kitmi/jacaranda
@kitmi/utils
/
src
/
keyAt.js
12 lines
(10 loc)
•
269 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
/** * Returns the key at the specified index of an object. *
@param
{
Object
}
object
*
@param
{
integer
}
index
*
@returns
{
String|*
} */
function
keyAt
(
object
, index
) {
return
object
==
null
?
undefined
:
Object
.
keys
(
object
)[index ??
0
]; }
export
default
keyAt;