How can I optimize this code?for(var i = 0; i<people_to_save_parse.length;i++){                if($(.ID-+people[i].tdid).is(':checked')==true)                {                    people_to_save_parse[i].id = $(.ID-text-+people[i].tdid).text();                }else{                    people_to_save_parse[i].id = ;                }                if($(.Name-+people[i].tdid).is(':checked')==true)                {                    people_to_save_parse[i].firstname = $(.Name-text-+people[i].tdid).text();                }else{                    people_to_save_parse[i].firstname = ;                }                if($(.Surname-+people[i].tdid).is(':checked')==true)                {                    people_to_save_parse[i].lastname = $(.Surname-text-+people[i].tdid).text();                }else{                    people_to_save_parse[i].lastname = ;                }}
Checking if switch is checked and doing something with the data
javascript;jquery