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>