Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
array to map merged with optional overrides
node v11.15.0
version:
1.0.0
endpoint
share
tweet
const {List, Map} = require('immutable'); const schemaNames = Array('a','b','c'); const schemaNamesOverrides = Map({a:'4',c:'5'}); let foo = List(schemaNames) .toMap() .mapEntries(([_index, schemaName]) => [schemaName, schemaName]) .merge(schemaNamesOverrides || {}) .map(entity => entity+"_blah"); console.log(foo);
Created from: https://immutable-js.github.io/immutable-js/
Loading…
no comments
sign in
to comment