Skip to content

Tag: multidimensional-array

Recursively filter an array of infinitely nested objects by mutliple matching conditions but only return parent that has an instance of both matches

I have the following array of objects; however this could be any unknown key/value and be infinitely nested, for now this is a testing sample: My current implementation is as follows: Basically I am adding to the “selected” array then using that to filter the data array by. I do want to ensure the…

JavaScript sort multiple array

Suppose I have this data Name Mark John 76 Jack 55 Dani 90 and for the grade Marks Grade 100-80 A 79 – 60 B 59 – 40 C suppose i declare the script as The program should assign the grade with the corresponding mark, how do I sort the grade since we know we cant change the index for