[NFBCS] JavaScript Converting Keys and Values into a Variable

dan.tevelde at comcast.net dan.tevelde at comcast.net
Wed Mar 2 19:27:13 UTC 2022


I am studying JavaScript and need to convert an array of nested objects into
a new array which is not nested. The input object is defined as a nested
array in a global variable with keys and values. The outer array is a list
of students. For each student there is an inner array containing the days of
the week with Boolean arguments true or false. I need to create a new array
containing the list of students for a given day. The day is passed as an
argument into a function. Is there a way I can convert the object keys and
values into a Variable with placeholder text for the names of the students
and days of the week. I could use the object.keys and the Object.values
methods but I'm not sure if I can compare the keys to the argument in the
function. Since the object is defined in a global variable I don't actually
know the names of the keys.

 

Thanks,

Dan



More information about the NFBCS mailing list