3 ms·
Someone asked for this elsewhere, it's really simple. Kinda odd that it's not in the standard, though. EDIT: It's because Maps preserve insertion order, so the
by nawitus 12y ago
Someone asked for this elsewhere, it's really simple. Kinda odd that it's not in the standard, though. EDIT: It's because Maps preserve insertion order, so the standard doesn't advocate use like this.
var objectToMap = x => new Map(Object.keys(x).map(o => [o, x[o]]));