SOURCE

   //逻辑运算
   var intersection=true && (1>2); 
   document.write("true && (1>2):"+intersection+"</br>");

   var union=true || (1>2); 
   document.write("true || (1>2):"+union+"</br>");

   var not=!(1>2); 
   document.write("! (1>2):"+not+"</br>");

    document.write("............................<br/>");
   //条件运算
   var condition=(3>5)?"你":"我";
   document.write('(3>5)? "你" : "我": '+condition+"</br>");

    document.write("............................<br/>");
    //字符串转数字
    var a = Number("2018") + 1000;
     document.write(a+"</br>");

     document.write("Number('123'):" + Number("123") + "<br/>");
    document.write("Number('3.1415'):" + Number("3.1415") + "<br/>");
    document.write("Number('hao123'):" + Number("hao123") + "<br/>");
    document.write("Number('100px'):" + Number("100px") + "<br/>");
//parseInt()提取的是整数部分,parseFloat()不仅会提取整数部分,还会提取小数部分。
    document.write("parseInt('123'):" + parseInt("123") + "<br/>");
    document.write("parseInt('3.1415'):" + parseInt("3.1415") + "<br/>");
    document.write("parseInt('hao123'):" + parseInt("hao123") + "<br/>");
    document.write("parseInt('100px'):" + parseInt("100px") + "<br/>");

    document.write("............................<br/>");
    //数字转字符串:(1)与空字符串相加(2)toString()
    var a = 2018 + "";
    var b = a + 1000;
    document.write(b+"</br>");

    var a = 2018;
    var b = a.toString() + 1000;
    document.write(b+"</br>");

    document.write("............................<br/>");
    //转义字符
    //(1)如果是在document.write()中换行,则应该用:<br/>
    //(2)如果是在alert()中换行,则应该用:\n
    //\':英文单引号;  /":英文双引号
    document.write("绿叶,给你\"初恋\"般的感觉~");
console 命令行工具 X clear

                    
>
console