JavaScript Random Sorting

Source: Internet
Author: User
Tags arithmetic operators bitwise bitwise operators logical operators naming convention script tag

08.11

# JavaScript Basics
# # programming language
* Machine language
* Assembly language
* Advanced Language
* Compiled type
* Explanatory type

# # # JavaScript Development
* ECMA3 has established a position
* ECMA5
* ECMA6 (ECMA2015 ECMA2016 ECMA2017)


# # #客户端 JavaScript composition
* ECMASCRIPT (core basic grammar)
* BOM (Browser model)
* DOM (Document Object model)

# # #客户端 JavaScript composition
* ECMASCRIPT (core basic grammar)
* BOM (Browser model)
* DOM (Document Object model)



# JavaScript Basic Syntax
The use of # # # in HTML
* Use script tag to introduce JS file
* Write the JS code in the script tag

# # # JavaScript annotations
* Single-line comment//comment
* Multi-line Comment/* Comment */

# # # JavaScript directive Terminator
* Line break
* Semicolon


Output of # # # JavaScript
* Console output Console.log ()
* Bounce Box Output alert ()
* Output to page document.write ()

# JavaScript variables
### Direct amount
## #变量: Container for data loading
### variable naming convention
*   cannot start with a number
*   has numbers, letters, underscores
*   cannot make reserved words
## #命名方式
*   Small hump    userage
*   Big hump    userage
*   Hungary    user_age
### declaration variable
        &NBSP
         var variable name = value;
        var var01=val,var02=value;   //declaring multiple variables

# JavaScript data types
# # Original Type
* Number Numbers
* String Strings
* Boolean Boolean
* NULL Empty
* Undefined Not defined


# # Object Type
* Date
* Array
* Object
* .....


# # # Detection function
* typeof ()



# type
# # # Categories
* Integer integers
* Floating-point decimals

# # # Direct Volume representation
* Decimal integer or decimal 19.9
* Octal means 010
* Hexadecimal indicates 0x65
* Scientific Counting Method 7e6

# # # Special number
* InFinity Positive Infinity
*-infinity Negative infinity

### non-numeric value Nan (not a number)
*  evaluates to any number Nan
*  is not equal to any value


### numeric function
* isnan ()    determine if Nan   true/false
* isfinite ()    infinite



# string string
### definition string
*  double quotation mark
*  single quote

### escape character
\ "
\ '
\n    line break
\r     carriage return
\t     tab TAB
\v    vertical tab
\f     page Break
\b     backspace
\\ 

### string connector
*  +

 

08.14

# Data type conversions
# # # Automatic conversion (in some computing environment)
* Number Environment
* String Environment
* Boolean Environment

# # # Forced type conversions
* Number ()
* String: Pure numeric characters and null characters are converted to normal numbers, other Nan
* Boolean value: Ture:1 false:0
* String ()

* Boolean ()
* Converted to false: number 0, empty string, null and undefined
* Convert to True: value indicates something
* parseint ()
* Convert to Integer
* Differs from number: A string that begins with a digit and does not convert to Nan
* Parsefloat ()
* Convert to Decimal or integer
* Differs from number: A string that begins with a digit and does not convert to Nan



# JS Operation HTML
# # Events
* onclick

# # function
* Declaring functions

Function name () {
Code
}
* Call function

Function name ()


# # # Get elements
* document.getElementById ("")
* JS code is written behind the HTML element

# # # JS Operations HTML element properties and CSS Data
* Element object. Property name
* Element object. style. Property name
* CSS attribute name with small hump naming method. Only CSS properties that are written in the element style can be retrieved
* innerHTML Property Gets or sets the contents of the double tag



# An expression
* Simple expressions; variables, direct quantities
* Complex expression; The combination of an operator and a simple expression
* Function-Call expression



# operator
# # Arithmetic Operators
* Plus operator +
* Minus operator-
* Multiplication Sign operator *
* Division sign operator/
* Take the remainder operator (modulo)%
* Negative operator-
* Positive operator +
* Increment operator + +
* Decrement Operator--


# # comparison operator
* Equality operator = =
* Inequality operator! =
* congruent operator = = =
* Non-congruent operation operator!==
* Less than operator <
* Less than equals operator <=
* Greater than operator >
* Greater than equals operator >=
* In operator

# # logical operators
* Logic and (and) &&
* Logic or (or) | |
* Logical Non!

# # # Bitwise operators
* Bitwise AND &
* Bitwise OR |
* Bitwise NON ~
*  bitwise XOR or    ^
*  left shift     <<
*  move right    >>


### assignment operator
* =
*   +=
*  -=
*  *=
Span style= "COLOR: #808080" >*  /=
*  %=


### other operators
*  string connector +
* , operator
* typeof operator
*  comparison operator     an expression? Expression 1: expression 2
 

# operator precedence

JavaScript is organized randomly

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.