Variables and data types

Source: Internet
Author: User

variable var a=10; A=20; Note: The variable declaration is released after the browser is closed, and you can use the var variable name before closing=Value Note: JavaScript is a weakly typed language var a=10; statement a=10; Assignment data type typeof (variable); 1. Number (int float DoubleNote: The calculations are still separated by integers and floating point types.2, String (stringChar)    3.Boolean4, Object (obejct arrayNULL) Integer: var a=45; var a=045; var a=0xff; Floating point: Var f=10.5; var f=10.55; var f=10.5e+10; String:' "" +concatenate two string operators and expression arithmetic operators+ - * / % ++ --Note:+when any string is encountered, it becomes a string join assignment operator= + - += -= *= /= %=Conditional Operators> < = = = = = =!==logical Operators&& | | ! ^ & |Note:&& | |will short-circuit, the individual will not short-circuit. Short-circuit refers to the left-hand side of the code-bit operator that can draw a conclusion .>> >>> << | & ~ ^NOTE: Bitwise operators are other operators that operate on the complement of binary?: Logical Statementsif(bool) {}if(bool) {}Else{        }        if(bool) {}Else if(bool) {} ...}Else{        }        Switch(variable) { Casevalue 1: expression [ Break;]  Case ... [default]    }        if(bool) {if(){            Switch(){                        }        }    }Else{         for(){             while(){                        }        }    }         while(){        }         Do{        } while()         for(;;) {        }
var c=10; </script> <body> <a href= "Javascript:alert (c)" >wwwww</a> <script>/*var a=false;            a=0.0;//0 denotes False if (a) {alert ("11111111");            }else{alert ("000000"); }        */var a=76; var b=34; Alert (A|b); </script> </body>Alert (1); document.write (' <table border= ' 1 "width=" align= "Center" > "); var i=0;  while(i<100){            if(i%10==0) {var bg; if(i%2==0) BG= "#cccccc"; ElseBG= "#ffffff"; document.write (' <tr> '); } document.write (' <td> ' +i+ ' </td> '); I++; if(i%10==0) document.write (' </tr> '); } document.write (' </table> '); </script> </body>View Code

Variables and 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.