const schoolObj = {
class10: { studentName: John, result: pass },
class11: { studentName: Alis, result: pass },
class12: { studentName: Nick, result: fail },
};
Is there a way to generate a list of student names when the result is marked as pass? The classes - class10, class11, and class12 are all dynamic values. I'm facing an issue on how to access these dynamically changing values during iteration.
The desired output should be an array like student = [John, Alis]