This is a blog about JavaScript, which I saw on the clang. The author introduced quite comprehensive, so reprinted to let interested friends to see. Oh ~ ~ ~ ~
There are times when you are proficient in a language, but it turns out that you're
1 How to create an object:
1. Use constructor, for example:
var obj = new Object ()//var can be omitted
var obj = new Date ()
2. Use object literal value (literals),For example:
Program code
var obj = "123"//Create a String object
var obj
Copy Code code as follows:
Ext.state.CookieProvider = function (config) {
Ext.state.CookieProvider.superclass.constructor.call (this);
This.path = "/";
This.expires = new Date (new Date (). GetTime () + (1000*60*60*24*7)); 7 days
In the previous article we introduced JavaScript regular expressions and string regexp and string (a), and this article continues to share relevant content.
Objective
I think that in the process of learning a programming language, strings, arrays,
A string object is used to process text (strings).
1. Create string
Copy Code code as follows:
var str = "Hello world";
var str1 = new String (str);
var str = String ("Hello World");
All three methods are OK, but slightly
This article introduces the basic (commonly used) grammar of JavaScript for your reference.
Overview
Let's talk about how JavaScript should be written. Two forms, one is to write JavaScript directly in the HTML page, the other is to exist in the *.
Unary operatoran operator that can manipulate only one value is called a unary operator.The unary operator is the simplest operator in the ECMAScript.
1. Increment and decrement operatorsthe increment decrement operator borrows directly from C and
Use the IEEE754 format to represent integer and floating-point values.floating-point value: The value must contain a decimal point, and must have at least one digit after the decimal. A floating-point number requires a memory space that is twice
There are also some properties and methods for the built-in math math entries and functions. For example, the Pi property of the Math object will have the property value Pi (3.141 ...), and you can call it like this:
Math.PI
Similarly,
Conditional Judgment Statement 1.if statement
if (condition) statement1 else statement2
The condition condition can be any expression, and the result of the evaluation of the expression is not necessarily a Boolean value. ECMAScript
The meta pattern differs from the general design pattern in that it is mainly used to optimize the performance of the program, which is best suited for solving the performance problems caused by a large number of similar objects. The meta mode
Operations on variables in JavaScript are referred to by reference, and the same is the case for arrays.
Two days ago want to copy an array, has been struggling to find a way (traversal of the method I was absolutely not used)
Accidentally picked
For a long time (here I want to gloat to say), JS is "a decorative role, complete a very limited function, such as form verification, the language itself has been used as a procedural language, it is difficult to complete complex functions." ”。 But (
This one is to read the value of the TextArea MaxLength property, to calculate, the idea is very good, but the modification of the trouble Ah, but for JS enthusiasts is a good reference, by reading the property value to control.
;
I got a question about the text box ReadOnly property this morning.
Specifically: Use JavaScript to modify this property.
Just start in the JavaScript is dead or alive can not get the value of this property, no way, to search the Internet. Not
The array type in JavaScript differs greatly from an array in other languages. each item in JavaScript can hold any type of data. also, the size of the JavaScript array can be dynamically adjusted and can grow automatically as the data is added to
Common Operations Summary of date types in JavaScript
/** 3. * Date Time Script Library method list: 4. * (1) Date.isvalidate: Date legality verification 5. * (2) Date.isvalitime: Time Validity verification 6. * (3) Date.isvalidatetime:
In our usual development process, we will certainly encounter this situation: while dealing with simple objects and complex objects composed of simple objects, these simple objects and complex objects will be grouped into a tree structure, when the
In JavaScript, a reference type is a data structure that is used to organize data and functionality together.
An object is an instance of a specific reference type. How objects are created:
var person = new Object ();
The example above
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