jQuery loop through checkboxes : I have these checkboxes:

    <input type="checkbox" class="ids" name="ids[]" value="2">
    <input type="checkbox" class="ids" name="ids[]" value="3">
    <input type="checkbox" class="ids" name="ids[]" value="4">
    <input type="checkbox" class="ids" name="ids[]" value="5">
    <input type="checkbox" class="ids" name="ids[]" value="6">

My question is via jquery, how would I loop through the ids[] on form submit?

    $("#form").submit(function(e) {
    
       //Loop throught ids[]
    
    });