按第 5 个字段对多维数组进行排序
我有一个数组的数组(二维):
var myArray = [
["DVD Title 1","label1","releasedate2","details1", 5241.2541],
["DVD Title 1","label3","releasedate1","details1", 8452.654],
["DVD Title 1","label3","releasedate2","details1", 45465.5465],
["DVD Title 1","label2","releasedate1","details1", 451.545],
["DVD Title 1","label1","releasedate1","details1", 7458.6545],
["DVD Title 2","label2","releasedaten","detailsn", 4545.545],
["DVD Title 2","label1","releasedaten","detailsn", 545.545]
];
我想按升序对这个数组进行排序,按第五个字段(浮点数)。
是否可以?
I have an array of array (2 dimensions):
var myArray = [
["DVD Title 1","label1","releasedate2","details1", 5241.2541],
["DVD Title 1","label3","releasedate1","details1", 8452.654],
["DVD Title 1","label3","releasedate2","details1", 45465.5465],
["DVD Title 1","label2","releasedate1","details1", 451.545],
["DVD Title 1","label1","releasedate1","details1", 7458.6545],
["DVD Title 2","label2","releasedaten","detailsn", 4545.545],
["DVD Title 2","label1","releasedaten","detailsn", 545.545]
];
I want to sort this array, order by ascending, by the 5th field (the float number).
Is it possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)