title: How Can I save a javascript map object to database
body: <p>I am able to get my map object as</p>
  <pre><code>Map(3) {'2a820899-844f-4fe1-bec6-e4c348920485' =&gt; 'Yes', 'c30102dc-ffe8-4a3f-9498-59625d9981c4' =&gt; 'Me is me', '5b44fe6a-2453-43f9-bf1b-3c3adc51cc96' =&gt; 'Yes'}
  </code></pre>
  <p>when I log it to the console. but when I send it to the backend, I get an empty object. How do i fix this?</p>
  <pre><code>const [answers, setAnswers] = useState(new Map())
  
    function updateAnswer(id, value) {
      const newMap = new Map(answers)
      newMap.set(id, value)
      setAnswers(newMap)
    }
  
  const handleSubmit = async (e) =&gt; {
      e.preventDefault()
      console.log(answers)
      await createAnswers(name, phone, email, city, answers)
    }
  </code></pre>
  <p>on the console, I get the above data. But when I save it, I gt an empty object</p>
  <pre><code>export const createAnswers = (name, phone, email, city, answers) =&gt; {
    return request('/v1/answers', {
      data: {
        name,
        phone,
        email,
        city,
        answers,
      },
  
      method: 'POST',
    })
  }
  </code></pre>