skip to Main Content

Javascript – filtering an object-array based on another object-array (orderly)

here is my data: arrayA= [{"studentID":1,"Type":"A"},{"studentID":2,"Type":"B"},{"studentID":3,"Type":"C"},{"studentID":4,"Type":"A"}] filteredArrayOrderlyOn = [{"studentID":1},{"Type":"A"}] (depending on the order the user selects the filters) Output should be arrayA = [{"studentID":1,"Type":"A"}] or if the filteredArrayOrderlyOn array changes because user has control on this selection. filteredArrayOrderlyOn = [{"Type":"B"},{"studentID":1}]…

VIEW QUESTION

Javascript – const data = Object.fromEntries(formData);

How to add an array to the last in this object: const formElment = document.querySelector(".form"); formElment.addEventListener("submit", (event) => { event.preventDefault(); var array = []; var checkboxes = document.querySelectorAll("input[type=checkbox]:checked"); for (var i = 0; i < checkboxes.length; i++) { array.push(checkboxes[i].value); console.log(checkboxes[i].id);…

VIEW QUESTION
Back To Top
Search