为什么我使用了if,却打印了所有值?
<!DOCTYPE HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>流程控制语句</title>
<script type="text/javascript">
//第一步把之前的数据写成一个数组的形式,定义变量为 infos
var myarr=[['a','female',21,'yi'],['b','male',23,'san'],['c','male',24,'si'],['d','female',21,'yi'],['e','female',22,'si'],['f','male',21,'yi'],['g','female',22,'er'],['h','female',20,'san']]
//第一次筛选,找出都是大一的信息
for(var i=0;i<8;i++){
if(myarr[i][3]=='yi')
{
if(myarr[i][1]=='female')
{
document.write(myarr+"<br>");
}
}
}
//第二次筛选,找出都是女生的信息
</script>
</head>
<body>
</body>
</html>