[JS Master's Road first part] JavaScript on hundreds of actual combat "new" _3 JavaScript variable type

Source: Internet
Author: User

JavaScript Data types

String, number, Boolean, array, object, Null, Undefined

1<! DOCTYPE html>234<meta charset= "UTF-8" >5<title></title>6<script>7         //The type of the variable is determined by the value of the variable.8         //Weakly typed languages9 Ten         //string type, quoted as String type One         //var userName = "Ghostwu"; A         //var username= ' GHOSTWU '; -         //How to view the type of a variable -         //typeof + Name of the variable the         //alert (typeof userName); String -  -  -         //var age =; +         //alert (typeof age); Number (numeric type) -  +         //var n = 0.2; A         //alert (typeof N); at  -  -         //Boolean type (true/false) -         //var a = true; -         //alert (true); -         //alert (typeof true);//boolean in         //var a = false; -         //alert (typeof a);//boolean to  +         //var a = ' true ';//string -         //var a = ' false ';//string the         //alert (typeof a); *  $ Panax Notoginseng         //objects: Objects, a thing ... - //var a = document; the //alert (typeof a);//object (object) +  A //var A; the //alert (a);//When declaring a variable, no value is given, then his value is undefined + //alert (typeof a);//type (undefined); -  $  $ //var a = null; - //alert (a); - //alert (typeof null);//Empty Object the  - Wuyi  the         varA = 10; -A = ' Hello '; WuAlerttypeofa); -  About  $  -  -</script> - A<body> +  the</body> -

[JS Master's Road first part] JavaScript on hundreds of actual combat "new" _3 JavaScript variable type

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.