title: Get the variable data/result from the promise in React JS after running it through map
body: <p>I want the result of activeCustomers array inside the last then but I keep getting an error saying arrow function expects a return. Not sure how I can get activeCustomers?</p>
  <pre><code>const CreateCustomer = (storeData) =&gt; {
    let activeOrganization = null;
    storeData.Org
      .getOrganization()
      .then(function createCustomer(organization) {
        activeOrganization = organization[0];
  
        const dataArray= storeData.attributes;
        activeOrganization 
          .createAttributes(
            attributeType[0],
            getSomeData(dimensions)
          )
          .then(function Properties(createdAttribute) {
            updateCustomerProperty(createdAttribute, attributeType[0]);
          });
         activeOrganization 
          .createAttributes(
            attributeType[1],
            getSomeData(dimensions)
          )
          .then(function Properties(createdAttribute) {
            updateCustomerProperty(createdAttribute, attributeType[1]);
          });
       }).then(() =&gt; {
        activeOrganization
          .getCustomers()
          .then((cusomters) =&gt; {
            const activeCustomers = [];
            cusomters.map((customer) =&gt; {
              activeCustomers.push(customer);
            });
            return activeCustomers;
          })
          .then((activeCustomers) =&gt; {
            console.log(activeCustomers);
          });
      });
  };
  
  //Now I want the result of activeCustomers array inside the last then but I keep getting an error saying arrow function expects a return. Not sure how I can get activeCustomers?
      
  </code></pre>
  <p>I want the result of activeCustomers array inside the last then but I keep getting an error saying arrow function expects a return. Not sure how I can get activeCustomers?</p>