I am a beginner to Javascript and struggling a lot with structuring and displaying my data. I have 4 arrays:
iDs[0] is the id of source[0]. messages [0] represent the messages of source [0] and time [0] represent the time of messages[0]. For e.g. [a,a] is the message from ABC with time [123, 456], [b,b] is the message from DEF with time [789, 101112] and so on.
This is clearly not a good way to link these arrays. How can I best group and link these arrays into one data structure?
JavaScript:
var iDs = [1234, 5678]
var sources = [[ABC, DEF, GHI], [ABC, DEF, GHI]]
var messages = [[[a, a,], [b ,b ], [c ,c]], [[aa, aa,], [bb ,bb ], [cc ,cc]]]
var time = [[[123, 456,], [789 ,101112 ], [1314 ,1516]], [[112, 223,], [563 ,657 ], [890 ,7869]]]
iDs[0] is the id of source[0]. messages [0] represent the messages of source [0] and time [0] represent the time of messages[0]. For e.g. [a,a] is the message from ABC with time [123, 456], [b,b] is the message from DEF with time [789, 101112] and so on.
This is clearly not a good way to link these arrays. How can I best group and link these arrays into one data structure?
Last edited: