JS---11 operator, Process Control, true and False

Source: Internet
Author: User

<! DOCTYPE html>/*var i = 0;i++;if (i = = 5) {i = 0;} i%=5;*/window.onload=function (){    varALi = document.getElementsByTagName (' li '); vararr = [' red ', ' yellow ', ' blue '];varstr = ";  for(vari=0; i<ali.length; i++) {Ali[i].index=i; Ali[i].style.background= arr[i%Arr.length]; Ali[i].onmouseover=function (){             This. Style.background = ' Gray ';        }; Ali[i].onmouseout=function (){             This. Style.background = arr[ This. index%Arr.length];                        }; Ali[i].onmouseover=function() {str= This. Style.background;//First Save Color             This. Style.background = ' Gray ';        }; Ali[i].onmouseout=function (){            //this.style.background = arr[this.index%arr.length];             This. Style.background =str;                }; Ali[i].checked= !ali[i].checked; varA = 120<90 && 20;//The front does not set up behind does not execute        varb = 120<90 | | 20>200;//before the establishment behind does not execute        varc =!!true; vard =! 200;//! Can be reversed, and data type conversions can be made, and any type can be turned to a Boolean type,    }};</script><style>li {height:24px; margin-bottom:3px; list-Style:none;}</style>
<! DOCTYPE html>varstr = ' JS ';Switch(str) { Case' JS ': Alert (' JS '); Break;  Case' HTML ': Alert (' HTML '); Break; default: Alert (str);}120<45? Alert (' 120<45 '): Alert (' 120!<45 ')); alert (120<450? ' 120<450 ': ' 120!<450 ' );varI=0; while(i<3) {alert (i); I++;} for(vari=0; i<6; i++){    if(i = = 4 ){        //Break ; Jump        Continue;//Skip over} alert (i);}</script>
<! DOCTYPE html>*     True and false questions: Data type-Number (NaN), String, Boolean, function, object (element, [], {}, null), undefined    true: A number other than 0 (positive or negative number is true), non-empty string (space is true), true, function, found element, array, JSON    false: 0, NaN, empty string ' ', false, Element not found, null, undefined */Ifnull  ) {    alert (' true ');} Else {    alert (' false ');} </script>

JS---11 operator, Process Control, true and False

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.