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>