//类
class studentClass {
  name: string;
  age: number;
  isChecked: boolean = false;
  constructor(studentDate: StudentInt) {}
}
//学生进入班级
let studentList2: Array<{ name: string; age: number; isChecked?: boolean }> = [
  { name: "xiaoming", age: 18, isChecked: true },
  { name: "xiaowang", age: 18, isChecked: true },
  { name: "zhangsan", age: 19, isChecked: false },
  { name: "lisi", age: 20, isChecked: true },
  { name: "wangwu", age: 21, isChecked: false },
  { name: "zhaoliu", age: 22, isChecked: true },
  { name: "sunqi", age: 23, isChecked: false },
  { name: "zhouba", age: 24, isChecked: true },
  { name: "wugeng", age: 25, isChecked: false },
  { name: "zhengshi", age: 26, isChecked: true },
  { name: "qianjiu", age: 27, isChecked: false },
  { name: "housan", age: 28, isChecked: true },
  { name: "yisi", age: 29, isChecked: false },
  { name: "wuyu", age: 30, isChecked: true },
  { name: "liuqi", age: 31, isChecked: false },
  { name: "qianba", age: 32, isChecked: true },
  { name: "jiusi", age: 33, isChecked: false },
  { name: "shiwu", age: 34, isChecked: true },
  { name: "eryou", age: 35, isChecked: false },
];

//学生打卡签到
//findIndex的定义是找出数组的第一个满足测试函数的元素索引
let idx = studentList2.findIndex((student) => (student.name = "wuyu"));
studentList2[idx].isChecked = true;
