You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

map.js 394B

1234567891011121314
  1. "use strict";
  2. var callable = require("./valid-callable")
  3. , forEach = require("./for-each")
  4. , call = Function.prototype.call;
  5. module.exports = function (obj, cb/*, thisArg*/) {
  6. var result = {}, thisArg = arguments[2];
  7. callable(cb);
  8. forEach(obj, function (value, key, targetObj, index) {
  9. result[key] = call.call(cb, thisArg, value, key, targetObj, index);
  10. });
  11. return result;
  12. };