Extracting data from a given day from an object in javascript
<p>I have an object of epochseconds and readings that I wish to extract data from.  The object is in the form:</p>

<p>obj[epochseconds] = reading</p>

<p>There is data every 900 seconds and I am using javascript.</p>

<p>I want to extract all the data from the latest date, the day previous to that and the day 7 days prior to that.  There should be up to 4*24 pieces of data per day and if there is no data for that date it should extract the data from the date nearest to that.</p>

<p>Additionally I want to extract all the data from a given day of the year on every year.  For example all the data from January 1 in 2000, 2001, 2002 and so on.</p>

<p>I have tried using a for loop and pushing the data into an array but as I have over 800,000 data points this takes over 20 seconds to complete and hangs the browser when doing so.</p>

<p>What is the quickest way to extract the required data?</p>