Front end of the Slack clone application.

key-of.js 290B

123456789101112131415161718
  1. "use strict";
  2. var eq = require("./eq")
  3. , some = require("./some");
  4. module.exports = function (obj, searchValue) {
  5. var result;
  6. return some(obj, function (value, name) {
  7. if (eq(value, searchValue)) {
  8. result = name;
  9. return true;
  10. }
  11. return false;
  12. })
  13. ? result
  14. : null;
  15. };