"JS Advanced Program Design" of the second

Source: Internet
Author: User

1, JS basic data type has number, String, number, Null, Undefined, Boolean, there is a complex data type Object,function and array is a derived type of object.

2, typeof used to determine the data type of a given variable,

"Undefined"-this value is undefined

"Boolean"-This value is a Boolean value

"String"-this value is a string

"Number"--this value is numeric

"Object"--this value is an object or null

"Function"-this value is

"NULL"--empty object

3, numeric conversion, number (), parseint (), parsefloat ()

4. Convert to String, toString ().

5. Properties of type Object:

Property Meaning
Constructor A function to create the current object is saved
hasOwnProperty (PropertyName) Used to check whether a given property exists in the current object instance
isPrototypeOf (object) Used to check if an incoming object is a prototype of another object
propertyIsEnumerable (PropertyName) Used to check whether a given property can use the For-in statement to enumerate
toLocaleString () Returns a string representation of the object that corresponds to the region of the execution environment
ToString () Returns the string representation of an object
ValueOf () Returns a string, numeric, or Boolean representation of an object

6, Logic and (&&) and logic or (| | ) is the short-circuit operator, the former if the first is false, then the second judgment will not be made; If the first one is true, then the second one will not be judged.

7, a value and a string to add, the result is a string, 5+ "5", the result is 55.

8. Equality operator (= = =), returns true only if the two operands are equal without conversion.

The non-congruent operator (!==) returns true only if the two operands are not equal without conversion.

Null = = Undefined, the result is true, but null = = = undefined and the result is false.

9, for-in statement, is an accurate iteration of the statement, can be used to enumerate the properties of the object.

  

 for inch expression) Statement For example: for(var in window) {   document.write (propname)  ;}

"JS Advanced Program Design" of the second

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.