function fromEntries(arr) { let obj = {}; for(let i = 0; i < arr.length; i++) { let value = arr[i]; obj[value[0]] = value[1]; } return obj; } let arr=[["first", 1], ["second",2]]; obj2 = fromEntries(arr) console.log(obj2.first) console.log(obj2.second)