How does js encapsulate data reasonably?

problem description: the front interface is a table. Clicking on the cell will return the custom data data on the cell and the corresponding cell line number.
is as follows:
Line number: 0Jing 2Jue 1
data:a,xy,xyz

requirements:
how to effectively encapsulate data? (deduplicated data remains unique) for example:

0 a,d,g,b,j
1 xd,ef,tg,sd

tables are suitable for data in two-dimensional array format, like this:

 

I don't quite understand what you mean by this effective encapsulation.

what you want to ask is how to remove the weight of the array?

Menu