Skip to content

fromLists

Subhajit Sahu edited this page Dec 8, 2022 · 11 revisions

Convert lists to object.

Similar: fromEntries, fromLists.


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

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


References

Clone this wiki locally