JavaScript authoritative Guide Learning Note 2

Source: Internet
Author: User

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

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.