I know this is old, but I think there's an error in the thought process here. The equivalent to the $.inArray() function would need to check to see if the
value exists in the object, not if the
key exists.
So correct me if I'm wrong, but I believe an equivalent function would have to look more like this:
- $.inObject = function(value, obj) {
- var foundKey;
- $.each(obj, function(key, val) {
- if (value === val) {
- foundKey = key;
- return;
- }
- });
- return foundKey;
- };