Es6 object structure assignment

 // const transferObj = {
          //   value: aggregations.all_zg.buckets[i].key,
          //   label: aggregations.all_zg.buckets[i].key,
          //   count: aggregations.all_zg.buckets[i].doc_count,
          // };
          

this is how I changed it

        const transferObj
          ({value,label,count} = {
            value: aggregations.all_zg.buckets[i].key,
            label: aggregations.all_zg.buckets[i].key,
            count: aggregations.all_zg.buckets[i].doc_count,
          })

but no, how should I write

Apr.16,2021

  

can't write zsbd
, nor can you click on it.
deconstructing assignment is to take the value from object and assign it to variables, instead of renaming key to generate a new object

.
Menu