src/utils.js
function findValueInObject(value, object) {
    checkHasType(object, "object", "Non-object value provided as second argument to findValueInObject");
    checkHasValue(object, "Invalid null object provided as second argument to findValueInObject");

    for (var key in object) {
        var objValue = object[key];

        if (deepEquals(value, objValue)) {
            return key;
        }
    }

    return; // explicit return of undefined
}
function findValueInObject(value, object) {
    checkHasType(object, "object", "Non-object value provided as second argument to findValueInObject");
    checkHasValue(object, "Invalid null object provided as second argument to findValueInObject");

    for (var key in object) {
        var objValue = object[key];

        if (deepEquals(value, objValue)) {
            return key;
        }
    }

    return; // explicit return of undefined
}
function findValueInObject ( value , object ) { checkHasType ( object , "object" , "Non-object value provided as second argument to findValueInObject" ) ; checkHasValue ( object , "Invalid null object provided as second argument to findValueInObject" ) ; for ( var key in object ) { var objValue = object [ key ] ; if ( deepEquals ( value , objValue ) ) { return key ; } } return ; // explicit return of undefined }
Locates the value provided under the first level of keys in the given object.
Since this function uses undefined as a return value when the provided value
is not found, it is not possible to directly search for anything where the key
is actually undefined. Anyone interested in this functionality can easily wrap
this method to check if undefined is a key in their object.

@param {mixed} value - A value to search for
@param {object} object - An object to search in
@returns {mixed} The key where the object was found, or undefined if it was not found
Locates the value provided under the first level of keys in the given object . Since this function uses undefined as a return value when the provided value is not found it is not possible to directly search for anything where the key is actually undefined . Anyone interested in this functionality can easily wrap this method to check if undefined is a key in their object .