The basic concept of javascript

Source: Internet
Author: User

1 /*2 * Case Sensitive3 * */4 5 //Use Strict mode6 functiondosomething () {7"Use Strict"//Plus this will tell the compiler to start strict mode8     //......9 }Ten  One /* A * Data Type - * Undefined The only value of uninitialized or undefined variables is Undefined - * Null an empty reference the * Boolean True/false note conversions for other data types and Boolean data types - * Number value type do not go to compare the size of the floating-point data Infinity (-infinity), more than the range of values nan-> should return a numeric value without returning a value - * Numeric conversion number () parseint () parsefloat () - * String type conversion. toString () + * The object type is a key-value pair - * Method with object type + * Constructor Create a function of the current object A * hasOwnProperty (PropertyName) has a property at * ISPROPERTYOF (object) is a prototype of another object - * propertyisenumberable (PropertyName) can use For-in - * tolocalestring () - * toString () - * VALUEOF () - * You can use the TypeOf operator to get the type of the variable in * - * to * Undefined derived from null so alert (null = = undefined)->true + * - * */ the functionTestvartype () { *     varA; $document.write (typeofa);//undefinedPanax Notoginsengdocument.write ("<br/>"); -document.write (typeofb);//undefined thedocument.write ("<br/>"); +  A     varc =NULL; thedocument.write (typeofc);//Object +document.write ("<br/>"); -  $document.write (typeof false);// Number $document.write ("<br/>"); -  -document.write (typeof"123");//string thedocument.write ("<br/>"); - Wuyi     varD = {"1": 1}; thedocument.write (typeofD);//Object -document.write ("<br/>"); Wu  -     varE =dosomething; Aboutdocument.write (typeofe);//function $document.write ("<br/>"); -  -document.write (NULL= = undefined);//true -document.write ("<br/>"); A  +document.write ("MAX:" +number.max_value); thedocument.write ("<br/>"); -document.write ("MIN:" +number.min_value); $document.write ("<br/>"); the  thedocument.write (IsNaN ("123"));//false thedocument.write ("<br/>"); thedocument.write (IsNaN ("Xixi"));//true cannot be converted to a number -document.write ("<br/>"); indocument.write (IsNaN (123));//false thedocument.write ("<br/>"); thedocument.write (IsNaN (d));//if the object is valueof first, not in ToString . Aboutdocument.write ("<br/>"); the}

1 /**2 * Created by Sherry on 15-7-7.3  */4 /*5 * Two ways to create an object6 * */7 functionCreateObject () {8     varperson =NewObject ();9Person.name = "ZLN";TenPerson.age = 26; One  A     //objects defined by literals do not call the object constructor -     varPersonnew = { -Name: "ZLN", theAge:26 -     }; -}

The basic concept of javascript

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.