Skip to content

Commit 8cb27b6

Browse files
committed
Alias mapObject to mapValues
For the record, I like `_.mapObject` better. But this change was undiscussed. Re: #2061, 4f771e0
1 parent 0e6d1e5 commit 8cb27b6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,6 +1381,7 @@ <h2 id="objects">Object Functions</h2>
13811381

13821382
<p id="mapObject">
13831383
<b class="header">mapObject</b><code>_.mapObject(object, iteratee, [context])</code>
1384+
<span class="alias">Alias: <b>mapValues</b></span>
13841385
<br />
13851386
Like <a href="#map">map</a>, but for objects. Transform the value
13861387
of each property in turn.

underscore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@
993993

994994
// Returns the results of applying the iteratee to each element of the object
995995
// In contrast to _.map it returns an object
996-
_.mapObject = function(obj, iteratee, context) {
996+
_.mapObject = _.mapValues = function(obj, iteratee, context) {
997997
iteratee = cb(iteratee, context);
998998
var keys = _.keys(obj),
999999
length = keys.length,

0 commit comments

Comments
 (0)