title: How to assign values from one object to another
body: <p>I am trying to do something simple where I have an object containing data. I am trying to take the values from that object and assign it to another object that I am going to use downstream. </p>
  
  <p>I have tried several ways to set the values</p>
  
  <pre><code> async componentDidMount () {
   try {
     const array = [
  
      {
        expanded: false, category_Name: "Mobiles", sub_Category: [{ 
   id: 1, name: 'Mi' }, { id: 2, name: 'RealMe' }, { id: 3, name: 
   'Samsung' }, { id: 4, name: 'Infinix' }]
    },
    {
      expanded: false, category_Name: "Laptops", sub_Category: [{ id: 
      8, name: 'Dell' }, { id: 9, name: 'MAC' }, { id: 10, name: 'HP' 
     }, { id: 11, name: 'ASUS' }]
    }
    ];
  
    const graphqldata =  await 
    API.graphql(graphqlOperation(listTodos))
  
    console.log('graphqldata:', graphqldata)
  
    this.setState({ AccordionData: array}, () =&gt; {});
    this.setState({ todos: graphqldata.data.listTodos.items })
    const items = this.state.todos.map((item, key) =&gt;
    console.log("printing just name", item.name)
    var singleAccordion = new Object()
    singleAccordion.category_Name=item.name
    singleAccordion.expanded=falise
    singleAccordion.sub_Category=[{1,item.date},{2,item.location}, 
    {3,item.organizer}]
    console.log("AND PRINTING singleAccordion", singleAccordion)
    )
    console.log('AccordionData:', this.state.AccordionData)
    } catch (err) {
    console.log('error fetching data: ', err)
    }
    }`
  </code></pre>
  
  <p>I expect the values in the "item" object to get assigned in the singleAccordian object the way I am trying to transform one from the other. But I am getting an error:
   189 |     const items = this.state.todos.map((item, key) =>
    190 |       console.log("printing just name", item.name)</p>
  
  <blockquote>
    <p>191 |       var singleAccordion = new Object()
          |       ^
      192 |       singleAccordion.category_Name=item.name
      193 | 
      194 |       console.log("AND PRINTING singleAccordion", singleAccordion)</p>
  </blockquote>