JS- How to convert an array with key and value pairs to an object?

前端 未结 0 592
一生所求
一生所求 2020-12-24 00:18
var arr = [];
arr[\'k1\'] = 100;
console.log(arr); //o/p - [k1: 100]
arr.length;       //o/p - 0
window.copy(arr);   //copies: []

I want to convert

相关标签:
回答
  • 消灭零回复
提交回复
热议问题