REVERSE_LOOKUP

Get key of the object by stored value

Description

Given a value and a target object, returns the key under which the given value is stored in the object. If multiple keys match the given value, the first key is returned.

Function signature

REVERSE_LOOKUP(object: Object, value: String|Number|Boolean|Array|Object) => String

Parameter

Description

Object

Object whose key will be get

Value

Value to find key

Examples

animal = {"name":"dog","weight":123,"active":false,"children":0}

Formula

Return value

REVERSE_LOOKUP(animal, 123)

weight

REVERSE_LOOKUP(animal, false)

active