Guest User

Untitled

a guest
Jun 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. var findKey = function(obj, value)
  2. {
  3. var key = null;
  4.  
  5. for (var prop in obj)
  6. {
  7. if (obj.hasOwnProperty(prop))
  8. {
  9. if (obj[prop] === value)
  10. {
  11. key = prop;
  12. }
  13. }
  14. }
  15.  
  16. return key;
  17. };
Add Comment
Please, Sign In to add comment