JavaScript language Core (2~12 chapter)
Chapter III: Types, values, variables
1. Numbers:
- Overflow (Infinity,-infinity), underflow (+0,-0)
- Non-numeric value: It is not equal to any value, including itself. if (x! =X) return nan;== "IsNaN () judgment is not NAN or string etc.
- The accuracy of JavaScript should be noted, IE (0.3-0.2)! = (0.2-0.1)
- Date () constructor: The month is counted starting from 0, the number of days starts at 1, and Sunday is 0;
2. Text:
- Escape character (keep in mind a few special values behind the slash: N,\,r,v,t,f,b,o, ",")
- Method of String (Length,charat,substring,slice,indexof,split,replace,touppercase)
- Regular Expression!!!!
3. Boolean value: false Example (Undefined,null,0,-0,nan, "")
4.null and Undefined:null are non-objects, undefined are undefined
5. Global objects:
6. Packaging objects:
7. Immutable Original values:
1 function Equalarrays (A, b) { 2 if (a.length!=b.length) return false ; 3 var i=0;i<a.length;i++) 4
if (A[i]!==b[i])
false Span style= "color: #000000;" >;
5
return
true
6 }
determine if an array is equal
8. Type conversion: conversion and equality, mainly converted to a number for comparison and other operations, if no meaning is converted to Nan; Display type conversions are similar to numbers ("3"), such as C and Viet Nam, and the ToString () method will throw exceptions except for null and undefined, and others will not.
9. Variable declaration:
10. Variable Scope:
1 functionTest (o) {2 varI=0;3 if(typeofo== "Object"){4 varJ=0;5 for(vark=0;k<10;k++){6Console.log (k);//0~97 }8Console.log (k);//Ten9 }TenConsole.log (j);//undefined One}Scope
JavaScript authoritative Guide Learning Note 2