How to get the value of a javascript object?
<p>I have an object and inside that object are further objects. I want to get the value of those objects. Thanks!</p>

<pre><code>      foreach($query as $row){
        $vehicles[$row-&gt;deviceID] = Array(
            'description' =&gt; $row-&gt;description,
            'deviceID' =&gt; $row-&gt;deviceID
        ); 
      }
</code></pre>

<p>and then I pass it to the view and stored it to a global javascript variable.</p>

<pre><code>      var vehicleList = &lt;?php echo $vehicleList; ?&gt;;
</code></pre>

<p>here is the output of my console.log if I type vehicleList in my console log in chrome:</p>

<pre><code>vehicleList

&gt;Object
  &gt;11292: Object
    description: "Bus 1"
  &gt;11293: Object
    description: "Bus 2"
  &gt;11294: Object
    description: "Bus 1"
</code></pre>

<p>The value I want to get is the description.
Is it also possible to store another value to the object 11292? If yes, how?</p>

<p>Thanks!</p>
