JSON structure changes the way the data is sorted by date

Source: Internet
Author: User

  data=[{"Content": "How to walk into the heart of mentally handicapped children", "title": "How to walk into the heart of mentally handicapped children", "second": 27, "Name": "Basic Course", "categoryId": "CourseID": 292, "Noteid": 143, "type": 1, "date": "11-23", "Specialid": 186}, {"Content": "The child's sense of security, not only the spiritual needs, but also the object The quality. So try to make a good example to your child.            "," title ":" How to build a child's sense of security "," second ": 0," name ":" Basic Course "," CategoryId ": 5, "CourseID": 818, "Noteid":, "type": 1, "date": "11-21", "Specialid": 172}, {"Content": "Guide children to learn to Thanksgiving parents, honesty for people, integrity work." "," title ":" "topic overview" Guide children to learn to Thanksgiving parents, honest people, integrity, "second": 0, "name": "Basic Course", "Catego     Ryid ": 5," CourseID ": 817," Noteid ": 129," type ": 1," Specialid ": 172}    ] Console.log (data.length);    var team_date = []; var indexs =-1;        Data.foreach (function (i,x) {console.log (i.date);            if (i.date) {var team = {aa: ', list: []} indexs++;            Team.date=i.date;            Team.list.push (i);        Team_date.push (team);        }else{Team_date[indexs].list.push (i); }    })

Http://jsrun.net/CGiKp/edit Online Case

JSON structure changes the way the data is sorted by date

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.