代码一般,水货到此一游
标签:
JavaScript
function Stu(name,sex,age,grade){
var stu = new Object()
stu.name=name;
stu.sex =sex;
stu.age = age;
stu.grade = grade;
return stu;
}
var stus = [];
stus[0] = Stu("小A","女",21,"大一");
stus[stus.length] = Stu("小B","男",23,"大三");
stus[stus.length] = Stu("小C","男",24,"大四");
stus[stus.length] = Stu("小D","女",21,"大一");
stus[stus.length] = Stu("小E","女",22,"大四");
stus[stus.length] = Stu("小F","男",21,"大一");
stus[stus.length] = Stu("小G","女",22,"大二");
stus[stus.length] = Stu("小H","女",20,"大三");
stus[stus.length] = Stu("小I","女",20,"大一");
stus[stus.length] = Stu("小J","男",20,"大三");
for(var i=0;i<stus.length;i++){
if(stus[i].sex=="女" && stus[i].grade =="大一"){
document.write(stus[i].name+"<br/>");
}
}
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦