javascript === 与 ==

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>test === </title>
	<script>
		/*
Identity operators: ===, !==
These operators behave the same as the equality operators, except that no type conversion is done. If the types of both expressions are not the same, these expressions always return false.
		*/
		window.onload = function  () {
			//if(1 == '1'){		// true
			if(1 === '1'){		// false
				alert('yes')
			}
			else{
				alert('no')
			}
		}
	</script>
</head>
<body>
	
</body>
</html>

 

posted @ 2015-10-23 09:15  庚武  Views(154)  Comments(0Edit  收藏  举报