I've managed to get the loop working in all browsers apart from Internet Explorer (which doesn't seem to support forEach).
The JavaScript cpde:
function validate() {
    var msg = '';
    var i = 0;
    arr.forEach(
        function validateinfo(){
            if (getRBtnName('yesNo_' + i + '_0' == "" && 'yesNo_' + i + '_0') == "") {
                msg = 'Please select yes/no for all users'
            }
            if (msg == '') {
                return true;
            }
            is++;
        }
    )
    if (msg == '') {
        reloadpage();
    }
    if (msg != '') {
        alert(msg);
        return false;
    }
}
function reloadpage(){
    window.location.reload()
}
The array is being set in the PHP file rather than passed in. It's being set using:
<script type="text/javascript">
    var arr = <?php echo json_encode($arr) ?>;
</script>
 
     
    