![](/img/trans.png)
[英]How i can update my todo status using checkbox in mean stack if check box is checked it place true in mongodb database otherwise false
[英]I have a array of objects to check from that primary is true is only one time on the checkbox otherwise show alert
假设您的数组是data
。
let primaryGuys = data.filter(person => person.primary === true);
if(primaryGuys >1) {
alert('HEY!')
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.