My task involves utilizing a dynamic array named var arr = ["key1","key2","key3"]
. The goal is to filter an array of objects using this array. Here’s an example:
var obj = [{"key1":{"key2":{"key3":5}}},{"key1":{"key2":{"key3":7}}},{"key1":{"key2":{"key3":8}}}]
I need to filter the objects so that "key3" equals 5. How can I accomplish this using plain vanilla JavaScript?