JavaScript second base

Regular expressions are used to support wildcards
may match any character
\ d matches any of the numbers 0-9
\ D matches non-numeric
\ s Match all whitespace characters, including spaces, tabs, line feed, carriage return, etc.
\ S matches any whitespace character
\ w matches any word character, including a 0-9, 26 English letters and underscore
\ W matches any non-word character
\ b matches a word boundary
\ B matches non-word boundary
[abc] Finding square brackets any characters between
[^ abc] does not find any character between the brackets
[0-9] find any number from 0 to 9
[az] Find any character from small a to small z's write
[AZ] Find from any uppercase a to uppercase Z characters
[Az] Find any character from uppercase a to lowercase z,
(red | blue | green) find any options specified
regular expression quantifier
n + matches any string containing at least one n,
n * matches any contains zero or more strings of n
n? matches any contains zero or a string of n
sequence n {X} n-X contains the matching string of
n {X, Y} X or Y contains a matching n sequence string
n {X,} matching string comprising at least the sequence X n,
n $ Matches any string ending n
^ n n matches any string that begins with
a regular expression modifiers
for case-insensitive matching performed i
JavaScript array syntax defined in the following three types:
<Script>
 var of arr1 = [2,5,6]; directly assigned to the array elements defined when //
 var arr2 = []; // define an empty array
 var arr3 = new array (); // define an empty array and be assigned by the index
 ARR3 [0] =. 1;
 ARR3 [. 3] = "ABC";
</ Script>
Tip: JavaScript provides an array length property length of the array to obtain .
JavaScript array features:
 variable length array. The total length is equal to the maximum array index value of +1
 elements in the same array type may be different
 when the unassigned access array element, the element value is undefined, not array bounds
1 ++ - operator effect
  ++: from Canada: the original data +1
  -: decrement: the original data for -1
2. use:
  alone: in front of and behind the same effect operand.
  Involved in operations using: When ++ after the variable (I +), the value of the variable will first do the assignment taken, then +1 itself  
          when the front variable ++ (+ I), will first itself + 1, then the result of the assignment +1
3. Example:
  Example 1. calculated for both values of x, y,?
    var X =. 3;
    var y = + ++ ++ X X * X + 10;
Var y = 3 + 5 + 5 * 10
  calculation:
    during calculation we look mixing formula, from left to right
    first x ++, ++ after the variable x, the value of the variable x is first to be put out the position (i.e., int y = 3 + ++ x + x * 10), and itself + 1; where the variable x = 3 + 1 = 4, ( if not understood, can make int a = x ++, then a = 3);
    followed by the front face to right ++ x, ++ in the variable x, first self +1 (i.e., x = 4 + 1 = 5) , and then into this position i.e. the value (int y = 3 + 5 + x * 10)
    last x * 10, at this time x = 5, i.e., int y = 3 + 5 + 5 * 10;
    end result is x = 5; y = 58;

Guess you like

Origin www.cnblogs.com/nbkls/p/12180849.html