REVERSE_LOOKUP_ALL

Get key of the object by stored value

Description

Given a value and a target object, return a list of all the keys under which the given value can be found.

Function signature

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

Parameter

Description

Object

Object whose key will be get

Value

Value to find key

Examples

animal = {"name":"dog","weight":123,"active":false,"children":0,"height":123}
animals = {"dog":"Richi","cat":"Tom","mouse":"Jerry","fox":"Alice","horse":"Richi"}

Formula

Return value

REVERSE_LOOKUP_ALL(animal, 123)

["weight","height"]

REVERSE_LOOKUP_ALL(animals, "Richi")

["dog","horse"]