0 points

javascript - Convert Array to Object - Stack Overflow


dashboard

Tue Jun 09 2020 10:44:39 GMT+0000 (UTC)

Posted by @UlisesVilla #javascript

function toObject(arr) {
  var rv = {};
  for (var i = 0; i < arr.length; ++i)
    rv[i] = arr[i];
  return rv;
}
content_copy Copy

Convert Array to Object

https://stackoverflow.com/questions/4215737/convert-array-to-object