this code below works well but the ESLint plugin show the warning:"Using 'ForinStatement' is not allowed" so i want to change it to other ways to prevent the warning message:
let count = 0;
for (const key in groups) {
if (Object.prototype.toString.call(groups[key]) === '[object Object]') {
if ({}.hasOwnProperty.call(groups[key], 'users')) {
count += groups[key].users.length;
}
}
}