Object Properties
Copy Code code as follows:
Document.title//Set document title equivalent to HTML label
Document.bgcolor//Set page background color
Document.fgcolor//Set foreground colors (text color)
1.null and undefined
* Get a property from an object that has a value of undefined if the object and its prototype in the chain do not have the property.* A function that returns the value to its caller without an explicit return value is undefined.
JavaScript has a number of tips to make programming easier. One of these is the eval () function, which can execute a string as a JavaScript expression. Here is a description of it
Eval function
Function: First explain the JavaScript code, and then
The specific code and comparison are as follows:
Copy Code code as follows:
JavaScript version of the common sort algorithm
Random number of Maximum random number Regenerate
Time consuming
We first look at the previous uniform Motion Code, modified the speed speed will appear after what kind of a bug. Two benchmarks are added to the test.
Copy Code code as follows:
"
In fact, such a code if the
__PROTO__ is an internal prototype, prototype is a constructor prototype (constructor is actually a function)
The stereotype of a constructor (prototype) is an object
So what is a builder?To create an object, you first have an object constructor,
Although arrays are objects in Javascript, it is not recommended to use a for in loop to traverse an array, in fact, there are many reasons to prevent us from using the for in loop for arrays.Because the for in loop will enumerate all the attributes
First, I want to talk about the loading and execution of JavaScript. Generally speaking, the browser for JavaScript to run two major features: 1 load immediately after the execution, 2 will block the subsequent content of the page (including page
In some programming languages like C, each piece of code within the curly braces has its own scope, and the variables are invisible beyond the declaration of their code snippet, which we call block-level scopes, and no block-level scopes in
In our daily development, manipulating and transforming arrays is a very common operation, and let's take a look at an example:
Copy Code code as follows:
var descolors = [],
Srccolors = [
{r:255, g:255, b:255},//White
{r:128, g:128,
Window object:
To open and close a window:
window.open ()
Three parameters: 1. URL of a page loaded into a new window
2. Name of the new window
3. Attribute string and description whether to replace the currently loaded page with a new loaded
Let's look at a piece of code first.
Function Show () {
alert (ABC);
}
var abc= "DEFG";
Show ();
People who have experience in C + + or Java programming may say, "This program is dead, and the variable is defined behind the function that
It is well known that PHP in the time type data can be directly converted to timestamp, then in the front-end script JS, there are methods can be achieved, is valueof ()
For example, we can use this code to output the timestamp of the current point
Look at the results of the following examples to know the problem:
The implementation results of these three examples are:
Copy Code code as follows:
Results#region Results
No.1
0
Undefined
No.2
0
1
No.3
0
Undefined
Provinces and cities two-level linkage drop-down menu, increased the area code input. Multiple sets of options share a set of data.
Select the region, you can get the area code, fill in the area code automatically selected.
In the area code
Copy Code code as follows:
ziyuanweihu
Card number Password Billing method Effective days Amount Affiliated Service Project Card issuing Time h000010010543860 Meter Point 2.0 Test Project 2006-06-23 10:14:40.843h000010011683352
For JavaScript, arrays are reference types, and if you want to copy an array, think about it, because functions, including concat and slice, are shallow copies. That is, for a two-dimensional array, using concat to replicate, a second-dimensional
False.tostring (); ' False '
[1, 2, 3].tostring ();//' 1,2,3 '
function Foo () {}
foo.bar = 1;
Foo.bar; 1
One oft-misunderstood thing is that numeric constants cannot be treated as objects, and numeric constants can still be treated as objects.
Copy Code code as follows:
result = "Integer 1" & "Integer 1"
& performs a bitwise AND operation on each digit of two 32-bit expressions. If the two digits are 1, the result is 1. Otherwise, the result is 0.
bit 1
JavaScript inheritance and standard OOP inheritance are very different, JavaScript inheritance is the use of prototype chain technology, each class will be "member variable" and "member function" on the prototype, js++ have superclass link it up,
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