//string
var studentName = "xiaoming";
//number
var studentAge = 18;
//Boolean
var isChecked = true;
//Date
var now = new Date();
//Array
var studentList1 = [
    { name: "xiaoming", age: 18 },
    { name: "xiaowang'", age: 18, isChecked: true },
];
var studentnew = {
    name: "xiaoming",
    age: 18,
    isChecked: false,
    works: ["yuwen"],
};
studentList1.push(studentnew);
var task1 = { progress: 1, complete: true, errorMsg: "youwenti" };
/**
 * 统计人数 没有接口表示
 * @param studentList{Array<StudentInt}  学生列表
 * @returns
 */
function checkCount1(studentList) {
    // let checkList = studentList.map(item=>item.isChecked ? 1:0)
    // let count = 0;
    // checkList.forEach(check=>{
    //   if(check==1)
    //     count ++
    // })
    var checkList = studentList.map(function (item) { return (item.isChecked ? 1 : 0); });
    var count = 0;
    checkList.forEach(function (checked) {
        if (checked == 1)
            count++;
    });
    return count;
}
/**
 * 统计人数 用函数接口表示
 * @param studentList{Array<StudentInt}  学生列表
 * @returns
 */
var checkCount = function (studentList) {
    var checkList = studentList.map(function (item) { return (item.isChecked ? 1 : 0); });
    var count = 0;
    checkList.forEach(function (checked) {
        if (checked === 1)
            count++;
    });
    return count;
};
var count = checkCount(studentList1);
console.log(count);
