JS Learning 20150318

Source: Internet
Author: User

Type Prefix type instance
Objects O Object Odiv
Arrays a array Aitems
String S-String sUserName
Integer I integer iitemcount
Boolean B boolean Biscomplete
Floating point F float fprice
FUNCTIONS fn function Fnhandler
Regular expression re RegExp Reemailcheck
Variant variable v variant vanything

Modulo% integer to seek "remainder"
10%3 1

If False in the case:
false,0, "", null, Undefined, NaN


Options tab

typeof

Undefined:2 type of situation:
1, there really is no definition
2. No assignment is defined

Null: Represents an empty object, but an empty object is also an object. So typeof null--"Object
Null: Yes, but it's empty.
Undefined: didn't give anything


parseint ()
Principle: Scans the entire string from left to right, and returns if it encounters a number that is not. If the first is not a number, then it will be an error.

Number (parameter)
Arguments cannot have something that is not a number, if any--"NaN


Get non-inline styles
Advanced Browser
getComputedStyle ("manipulated element", false). Property name of the style
Low-level browser ie8-
The element of the action. Cuurentstyle. Style Property Name
Cannot manipulate compound styles
JS inside operation style all have hump mark



Operator:
1. Arithmetic operators
2. Comparison operators
3. Assignment operators
4. Logical operators
Precedence of operators: Best brackets ()!!!
Common priority:
Assignment "logic" comparison "arithmetic

True 1 false 0 null 0


Math.random () [0, 1)
Random number of N to M [N, M]
Math.random () * (m-n) + N

JS Learning 20150318

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.