Passing objects and id as parameters in a function
<p>Working on some code and I'm running into an issue I don't know how to fix using javascript.</p>

<p>I have <code>days</code> that is a collection of objects that look like:</p>

<pre><code>day: 1
a: 10
b: 5
c: 9
d: 6 
</code></pre>

<p>and so forth.</p>

<p>What I want to do is have a function that I can pass <code>days</code> and one of the id's for <code>a, b, c, d</code> and have it do 'something'. (By something, I'm not sure yet).</p>

<p>I'm just struggling to figure out how to pass the identifier.</p>

<pre><code>function returnAll(data, id){
   for (var day in data){
    console.log('On day' + day + ' , ' + id + ' has a value of ' data[day].id)
   }
}
</code></pre>

<p>Which would ideally put something like this into the console:
    On day 1 , a has a value of ...
    On day 2,  a has a value of ...</p>

<p>When <code>returnAll(days, a)</code> is called,  I just can't get the id to link up properly inside of the function. I'll need to call this function for either a, b, c...The <code>days</code> can be dynamic so I need a function that operates just on the values of the <code>id</code> passed as the parameter.</p>

<p>Any thoughts?</p>
