Attempting to determine the length of an array using ES6 with the following code, but encountering issues.
a=[[1,2,3,4],[4,5,6]]
result = a.map(d=>({d[0]:d.length}))
console.log(result)
The correct method is:
a=[[1,2,3,4],[4,5,6]]
result = a.map(d=>({name:d[0], length:d.length}))
console.log(result)