js数组方法的使用以及一维数组转多维
从后端拿到json格式的数据之后,日期型变为了字符串,所以使用数组的一些方法将字符串转为数值型,然后根据需求将数据变为多维数组。
res=[{
"ed_max":"2010-07-30","year":2010,"ed_min":"2010-06-29","ed_avg":"2010-07-24","bd_min":"2010-05-04","bd_avg":"2010-06-03","bd_max":"2010-07-03"},{
"ed_max":"2011-08-31","year":2011,"ed_min":"2011-07-18","ed_avg":"2011-07-27","bd_min":"2011-05-31","bd_avg":"2011-06-02","bd_max":"2011-06-06"},{
"ed_max":"2012-08-24","year":2012,"ed_min":"2012-07-14","ed_avg":"2012-07-26","bd_min":"2012-05-01","bd_avg":"2012-05-22","bd_max":"2012-06-27"},{
"ed_max":"2013-08-27","year":2013,"ed_min":"2013-06-15","ed_avg":"2013-07-04","bd_min":"2013-05-02","bd_avg":"2013-06-03","bd_max":"2013-06-20"},{