Skip to content

Commit 29ad44b

Browse files
committed
Alias mapObject to mapValues
For the record, I like `_.mapObject` better. But this change was undiscussed. Re: #2061, 4f771e0
1 parent 6dff42a commit 29ad44b

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
@@ -1370,6 +1370,7 @@ <h2 id="objects">Object Functions</h2>
13701370

13711371
<p id="mapObject">
13721372
<b class="header">mapObject</b><code>_.mapObject(array, iteratee, [context])</code>
1373+
<span class="alias">Alias: <b>mapValues</b></span>
13731374
<br />
13741375
Like <a href="#map">map</a>, but for objects. Transform the value
13751376
of each property in turn.

underscore.js

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

952952
// Returns the results of applying the iteratee to each element of the object
953953
// In contrast to _.map it returns an object
954-
_.mapObject = function(obj, iteratee, context) {
954+
_.mapObject = _.mapValues = function(obj, iteratee, context) {
955955
iteratee = cb(iteratee, context);
956956
var keys = _.keys(obj),
957957
length = keys.length,

0 commit comments

Comments
 (0)