I have problem dealing with unchecking all checkboxes. When I click on a toggle all checkbox, it could check all checkboxes. But if I uncheck the toggle all checkbox, nothin
After validating that isAllCheck is correct with your UI logic, you may do both with a simple vanilla-js one-liner
isAllCheck
Array.from(document.querySelectorAll('input[type=checkbox]').forEach(el => el.checked = isAllCheck);