The success of JavaScript is repeat. Writing JavaScript code for Web pages is already the basic skill of all Web designers. This interesting language contains many unfamiliar things, even if JavaScript programmers who have been writing JavaScript for many years, not completely thorough. This article describes seven tips that are not familiar with but useful in JavaScript.
Simple statement
JavaScript can use simple statements to quickly create objects and arrays, such as the following code:
You can use the following simple statement:
The object car is created here, but note that do not add ";" before ending the curly brackets; "Otherwise, it will be very troublesome for IE.
The traditional method for creating arrays is:
Use the simple statement:
Another simple statement that can be used is the condition judgment statement:
It can be simply as follows:
JSON Data Format
JSON, short for "JavaScript Object Notation", is designed by Douglas Crockford. JSON changes the difficulty of JavaScript in caching complex data formats. For example, if you want to describe a band, you can write as follows:
- Four pages in total:
- Previous Page
- 1
- 2
- 3
- 4
- Next Page