KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
For some reason I'm having some serious difficulty wrapping my mind around this problem. I need this JS function that accepts 2 arrays, compares the 2, and then returns a string of the missing element. E.g. Find the element that is missing in the currentArray that was there in the previous array. function findDeselectedItem(CurrentArray, PreviousArray){ var CurrentArrSize = CurrentArray.length; var PrevousArrSize = PreviousArray.length; // Then my brain gives up on me... // I assume you have to use for-loops, but how do you compare them?? return missingElement; } Thank in advance! I'm not asking for code, but even just a push in the right direction or a hint might help...
Tags (comma-separated)
Save Edits
Cancel