How to get value stored in array object in javascript
<p>I m storing values as object which i get dynamically, now i need to retrieve those values, its simple question but i didnt get the answer so i asked here.  </p>

<p>for example:</p>

<pre><code>/* Adding values dynamically into array of saveData. */
at first :
id = 1
gettext = 'Y'
text = 'Hello world'
at second :
id = 2
gettext = 'N'
text = 'JavaScript'
etc....
</code></pre>

<p>My code: </p>

<pre><code>var saveData = {};
var objterm = {};

objterm["valueID"] = id;
objterm["valueGot"] = gettext;
objterm["text"] = text;
saveData[id] = objterm; // Saving values in array...
</code></pre>

<p>How can i retrive a value eg: say, saveData[1] -> gettext, text</p>

<pre><code>// I tried the below to get value as
        var obj = _.find(saveData, function(obj) { return obj.id == id }); // did nt get values 
</code></pre>