title: Extract values from json string javascript
body: <p>I am using a multiselect element from select2 to enter multiple "tags". When I want to get the value from the element I get something like this (for tag1 en tag2 which I entered in the box): </p>
  
  <pre><code>[{"id":"tag1","text":"tag1"},{"id":"tag2","text":"tag2"}] 
  </code></pre>
  
  <p>How do I get the result from text in an array something like this:</p>
  
  <pre><code>[0] = "tag1"
  [1] = "tag2"
  </code></pre>
  
  <p>And how do I reverse this process?</p>