map-obj-indexed

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
2 KB
An Object-specific version of [`map`](#map).
1 contributor
Install map-obj-indexed as a package?
Copied
npm i @bit/justin-capalbo.ramda.map-obj-indexed
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
mapObjIndexed (
fn:Function,
obj:Object
) : Object

An Object-specific version of map. The function is applied to three arguments: (value, key, obj). If only the value is significant, use map instead.

Example
const xyz = { x: 1, y: 2, z: 3 };
     const prependKeyAndDouble = (num, key, obj) => key + (num * 2);

     R.mapObjIndexed(prependKeyAndDouble, xyz); //=> { x: 'x2', y: 'y4', z: 'z6' }
Arguments
fn: Function
obj: Object
Returns
Object

Help and resources