Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

array to map merged with optional overrides

node v11.15.0
version: 1.0.0
endpointsharetweet
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