UNPKG
@ahsolo/lotide
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
lotide assignment for Lighthouse Labs coding bootcamp
github.com/ahSOLO/lotide
ahSOLO/lotide
@ahsolo/lotide
/
findKey.js
8 lines
(7 loc)
•
189 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
const
findKey =
function
(
object
, callback
) {
for
(
const
[key, value]
of
Object
.
entries
(
object
)) {
if
(
callback
(value))
return
key; }
return
undefined
; }
module
.
exports
= findKey;