mps*_*hat 3 javascript arrays jquery date
我有样本数据:
data = [
  [1, 622, 782, 783, "2015-04-21"],
  [2, 622, 782, 783, "2015-04-21"],
  [3, 622, 782, 783, "2015-04-22"],
  [4, 622, 782, 783, "2015-04-23"],
  [5, 622, 782, 783, "2015-04-24"],
  [6, 622, 782, 783, "2015-04-28"],
  [7, 622, 782, 783, "2015-04-28"],
  [8, 622, 782, 783, "2015-04-29"],
  [9, 622, 782, 783, "2015-05-04"],
  [10, 622, 782, 783, "2015-05-05"]
]
如何从上述数据中获取最大日期值和最小日期值?数据可能不按排序顺序排列.
fol*_*kol 11
var dates = data.map(function(x) { return new Date(x[4]); })
2)使用Math.max/ Math.min获取最高/最低日期:
var latest = new Date(Math.max.apply(null,dates));
var earliest = new Date(Math.min.apply(null,dates));
| 归档时间: | 
 | 
| 查看次数: | 8466 次 | 
| 最近记录: |