📅  最后修改于: 2022-03-11 15:04:19.929000             🧑  作者: Mango
function add(name) {
var id = arr.length + 1;
if (arr.filter(item=> item.username == name).length == 0){
arr.push({ id: id, username: name });
}
}