22关系运算符

时间:2021-07-12 17:40:35   收藏:0   阅读:0

个人学习随笔,不喜勿喷。(习自哔哩哔哩--尚硅谷)
以下内容均从HBuilder X直接粘贴过来,直接粘贴到相关编辑器可直接执行,以供学习。

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
		/* 其他略过
		 任何值和NaN比较都是false
		 */
		
		// console.log( 10 > "hello");
		// console.log( 10 < "hello");
		// console.log( 10 => "hello");
		// console.log( 10 <= "hello");
		
		/* 若符号两侧均为字符串,则不会转换为数字进行比较,而会分别比较字符串中字符的Unicode编码
		比较字符编码是一位一位进行比较,当当两位相同时,则比较下一位
		 */
		console.log( "25" > "89");//false
		console.log( "a" > "b" );//false
		console.log( "a" < "b" );//true
		console.log( "a" < "bc" );//true
		console.log( "a" > "bc" );//false
		console.log( "z" > "bc" );//true
		
		</script>
	</head>
	<body>
	</body>
</html>

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!