js逻辑运算符

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">html

<html xmlns="http://www.w3.org/1999/xhtml">ui

<head>spa

<title>js运算符</title>xml

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />htm

<meta name="description" content="布尔教育 http://www.itbool.com" />ip


</head>utf-8

    <body>it

     

<script>io

//拼接运算符+meta

var a="123";

var b=1;

document.write(b+a);//1123

//逻辑运算符

var c=false;

var d=6;

var e=true;

//js中逻辑运算符,返回最先能判断表达式结果的

document.write(c||d);//结果为6

document.write(c||d||e);//结果为6

</script>

    </body>

</html>

相关文章
相关标签/搜索