skip to Main Content

Append value to dictionary of dictionaries in Javascript

I have the following JS code: var expected_dict = {} for (var i = 1; i < expected_data.length; i++) { if (expected_data[expected_data[i][0]] == undefined) { expected_dict[expected_data[i][0]] = {} } expected_dict[expected_data[i][0]][expected_data[i][20]] = {} expected_dict[expected_data[i][0]][expected_data[i][20]] = expected_data[i][21] console.log(expected_dict) } expected_data is an…

VIEW QUESTION
Back To Top
Search