The objectConverter function, if I understand it correctly, takes an array of keys, and returns a function, that takes an array of values, and returns an object.
I'm guessing preserving IE11 compatibility was the goal, so here's an alternative that still does, while working without Function :
function objectConverter(columns){
return function(d){
var o = {};
columns.forEach(function(name, i){
o[name] = d[i];
});
return o;
};
}
And, for future reference, here's another one that uses the latest syntax :
Hello,
The
objectConverter
function, if I understand it correctly, takes an array of keys, and returns a function, that takes an array of values, and returns an object.I'm guessing preserving IE11 compatibility was the goal, so here's an alternative that still does, while working without
Function
:And, for future reference, here's another one that uses the latest syntax :
Thanks