find the length of array using map function ES6 : <p>I'm trying to find the length of an array using ES6 using the below code but it does not work.</p>

<pre><code>a=[[1,2,3,4],[4,5,6]]
result = a.map(d=&gt;({d[0]:d.length}))
console.log(result)
</code></pre>

<p>This works:-</p>

<pre><code>a=[[1,2,3,4],[4,5,6]]
result = a.map(d=&gt;({name:d[0], length:d.length}))
console.log(result)
</code></pre>
