please help. I have such a code with Checkboxes. I need to shorten it, namely to go through it through Foreach. If you can shorten it in another way, then please write it.. let FormData = { DisplayName: $("#DisplayName").is(":checked"), Department: $("#Department").is(":checked"), Post: $("#Post").is(":checked"), Phone: $("#Phone").is(":checked"), Location: $("#Location").is(":checked"), Dinner: $("#Dinner").is(":checked") } console.log(JSON.stringify(FormData)); I haven’t really tried… Read More Using Foreach or another function to reduce the amount of code