![](/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.