JSON format and abstract thinking

Source: Internet
Author: User

Week of study, this week's biggest harvest is JS in the use of JSON format and abstract ideas, such as:

var book=[{id:1,bookname: "Software Development", Writer: "Tom", type: "Programming Technology", Time: "1999-2-30", Price:50,picture: "A.jpg"},
{id:2,bookname: "HTml", Writer: "Wersmith", type: "Programming Technology", Time: "1999-7-20", Price:80,picture: "B.jpg"},
{id:9,bookname: "Journey to the Monkey", Writer: "Luo Guan zhong", type: "Novel", Time: "2009-10-10", Price:10,picture: "F.jpg"}]

This is the use of a JSON format, as well as abstract ideas, encapsulation can be reused code, packaging it into a function, not only can reduce the amount of code written, avoid code redundancy, but also can greatly improve efficiency, such as simple to find object code can be encapsulated into a function, as follows:

function $ (Nid) {
return document.getElementById (Nid);
}

JSON format and abstract thinking

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.