JavaScript authoritative guide (version 4) Reading Notes

Source: Internet
Author: User

Javascript is a non-typed and interpreted language.
Case Sensitive
Html is case insensitive
Ignore space characters, tabs, and line breaks (except keywords, variables, and regular expressions)
";" Semicolon selectable
// Single line comment
/* Multi-line comment */
The identifier must start with a letter, underscore, or $.
Keyword: break delete function return typeof
Case do if switch var
Catch else in this void
Continue false instanceof throw while
Debugger finally new true
Default for null try

A function is an object that can execute code.
Ordered Set <=> set
Boolean isNaN (numValue) // If numValue is meaningful, false is returned. If it is meaningless, true is returned.
Instructions for escape character collation
1 \ B Backspace)
2 \ f Form Feed)
3 \ n newline)
4 \ r Return (Carriage Return)
5 \ t tabulation (Tab)
6 \ 'single quotes
7 \ "Double quotation marks
8 \ Backslash)

Question: "\ 0" is a Null Character document. write ("\ 0") test
Copy codeThe Code is as follows:
/* Character (string) truncation */
<Script language = "javascript">
Var str = "abcdefghi ";

/* Return the characters at the specified index position */
Document. write (str. charAt (2) + "\ t ");
/// Return value c

/* The substring method returns a substring from start to end (excluding end */
Document. write (str. substring (2, 5) + "\ t ");
/// Return value cde

/* Returns a substring stringvar. substr (start [, length]) of the specified length starting from the specified position */
Document. write (str. substr (2, 4) + "\ t ");
/// Return value cdef
</Script>

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.