title: TypeError: values.map is not a function
body: <p>I am trying to map the <code>object</code> but in meantime it gives me the following error: <code>TypeError: values.map is not a function</code>. I am new to React development.</p>
  
  <p>I am using this method in Redux <code>method</code></p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>export function createEvent(values) {
    let modifyValue = values.map(newValue =&gt; {
      return {
        subject: newValue.id,
        taskType: newValue.tasktype,
        time: newValue.time,
        date: newValue.date,
        notes: newValue.notes,
        createdAt: newValue.createdAt,
        updatedAt: newValue.updatedAt,
        deletedAt: newValue.deletedAt,
        userId: newValue.userId,
        customerId: localStorage.getItem("customerValue"),
        start: newValue.start,
        end: newValue.end
      };
    });
    return dispatch =&gt; {
      axios
        .post("api/diary/create", modifyValue)
  
        .then(response =&gt; {
          return dispatch({ type: SET_DIARY_TASK_SUCCESS, data: response });
        })
  
        .catch((xhr, status, err) =&gt; {
          return dispatch({ type: SET_DIARY_TASK_FAILURE, data: xhr });
        });
    };
  }
  </code></pre>