Skip to content

fromLists

Subhajit Sahu edited this page Dec 5, 2022 · 18 revisions

Convert lists to map.

Similar: from, fromLists, fromKeys, fromValues.


function fromLists(x)
// x: lists, i.e. [keys, values]
const map = require('extra-map');

var ls = [['a', 'b', 'c'], [1, 2, 3]];
map.fromLists(ls);
// → Map(3) { 'a' => 1, 'b' => 2, 'c' => 3 }


References

Clone this wiki locally