JS generally has two different data types:
Basic type (including undefined, null, Boolean, String, number), passed by value;
The reference type (including arrays and objects) is passed by address. The reference type is the address in the memory
1. javaScript does not provide a method to directly define two-dimensional arrays, but you can use arrays that define arrays to define JavaScript two-dimensional arrays. For example, you can use the following method to define a 4x3 two-dimensional
Preface: domestic front-end research is not inferior in some aspects to foreign countries. Although I do not understand this article, I appreciate this spirit of in-depth research!
The topic of anti-corialization came from a piece of twitter last
Typeof is used to detect the Data Type of a given variable (also called Basic type, basic data type. Contains undefined, boolean, string, number, object, function)Var message = "so easy ";Alert (typeof message); // "string"Alert (typeof 12); //
1. Add brackets
[] + []
Brackets have no block clause, so the two brackets here are an array. To add two arrays (object types), convert them to value types (basic types ).
1. to convert the value type, call valueOf, [] valueOf () or your own.
Copy
Since the author's translation will add his understanding to help him learn and use it, if a good English speaker can see the following translation errors in the article, please leave a message, exchange and correct it .(:============================
In JavaScript, the valueOf function method returns the original value of the specified object. Usage:
Object. valueOf () object is a required parameter and is an inherent JScript object.
The valueOf method definition of each inherent JavaScript
The relationship between Javascript function scopes, calling objects, and closures is very subtle. There are many articles about them, but I don't know why many new users are hard to understand. I will try to express my understanding in a more
Copy codeThe Code is as follows: String. prototype. getParameter = function (key ){
Var re = new RegExp (key + '= ([^ &] *) (? :&)? ');
Return this. match (re) & this. match (re) [1];
};
Test code:Copy codeThe Code is as follows:
Output:0123
1. Original code, reverse code, and complement code, positive and negative subtraction to complement code addition
Javascript uses a 32-bit binary integer for binary operations. Because JavaScript integers are all signed numbers, the highest digit 0
String object
1. str. match (RegExp)
Search for strings matching RegExp in str and save them in a Number Group,
If RegExp is not set globally (/g), it only matches once.
Copy codeThe Code is as follows: ("abc0000dwfwabcwef2abc3wfwabcas20.abcqwf24j2
The factory mode is also one of the object creation modes. It is usually implemented in static methods of classes or classes. One way to construct an object is to use the new operator. However, when using the new operator, it is intended to
The procedure is as follows:
(1) Prepare an image (left and right arrows and some sample images)
(2) The JS (jquery) code is as follows:Copy codeThe Code is as follows:
(3) The Html section is as follows:Copy codeThe Code is as follows:
The
Var a = new Array ();If the definition is as follows: a [3] = "a"; alert (a. length) 4 is 1,If yes, but no value is assigned, an undefined (alert (a [0]) is returned.
Create an array:
Copy codeThe Code is as follows: arr = []; // Yes, It is an air
Because of work requirements, I need to write a script on the Web page to submit data to the system in batches through the web page. So I thought of the Greasemonkey plug-in, so I started to write and found that the problem was solved smoothly.
I. Preface
The JavaScript language is slightly different under different browsers, but it is not as big as DOM operations. Now we will list one of the differences in "for loop, it also describes how to effectively solve this difference.
Ii.
Fortunately, jQuery provides a built-in utility function. $ getScript () provides us with this method. To implement the dynamic functions of the webpage. Let's take a look at the syntax of this function:
$. GetScript (url, callback)
Obtains the
The Html and JS Code is as follows:
Copy codeThe Code is as follows: Style = "position: absolute; width: 100px;">
script house
Online running:Foot home [Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to
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