JavaScript data types

Source: Internet
Author: User

JS data types have undefined,boolean,number,string,object, such as 5, the first 4 are the original type, the 5th is the reference type.

Something special to be aware of. Null undefined NAN

(1) Undefined and null are equal, (2) Nan is not equal to any value, nor is it equal to itself.

var a1; var a2 = true;  var a3 = 1; var a4 =  "Hello";  var a5 = new object ( );  var a6 = null; var a7 = nan; var a8 = undefined ;  alert (typeof a);  //displays "Undefined"  alert (TYPEOF A1);  //displays "Undefined"  alert ( TYPEOF A2);  //displays "Boolean"  alert (TYPEOF A3);  //displays "number"  alert (TYPEOF A4);  //displays "string"  alert (TYPEOF A5);  //displays "Object"  alert (TYPEOF A6);  //displays "Object"  alert (TYPEOF A7);  //displays "number"  alert (TYPEOF A8);  //displays "Undefined" 

JavaScript Undefined Properties

Definition and Usage  
The undefined property is used to store JavaScript undefined values.



JavaScript data types

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.