JavaScript Authority Guide (Fourth Edition) reading notes _javascript tips

Source: Internet
Author: User
JavaScript is a type-free, interpretive language
Sensitive to case
HTML is insensitive to case
Ignore spaces, tabs, line breaks (except keywords, variables, regular expressions)
";" Semicolon to select
Single-line Comment
/* Multiline Comment * *
Identifiers must begin with letters, underscores, $ symbols
Keywords: break delete function return typeof
Case do if switch var
Catch else in this void
Continue false instanceof Throw while
Debugger finally new true with
Default for NULL try

function (functions), which is an object of executable code
Ordered sets <=> collections
Boolean isNaN (NumValue)///numvalue returns false, meaningless returns true
Escape word Fu She escape character Usage description
1 \b Back (Backspace)
2 \f Page Change (Form Feed)
3 newline (New line)
4 \ R Back (carriage return)
5 \ T Tabulation (tab)
6 \ ' single quotes
7 \ "Double quotes
8 \ Backslash (backslash)

Question: "A" is a null character document.write ("") test
Copy Code code as follows:

/* character (String) interception/
<script language= "JavaScript" >
var str= "ABCDEFG" Hi ";

/* Returns the character */
document.write (Str.charat (2) + "T") at the specified index position; The
///return value C

/*substring method returns a string containing a substring from start to the last (not including end) */
document.write (str.substring (2,5) + "\ t ");
///return value CDE

/* Returns a substring of the specified length starting at the specified position stringvar.substr (start [, length])/
document.write (str.substr 2, 4) + "T");
///return value cdef
</script>
Related Article

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.