how to eleminate the duplicate values and get the distinct values using jquery

how to eleminate the duplicate values and get the distinct values using jquery

iam developing web aplication,

  product      no                                                                                              product        no.
 
    x             1                                                                                                   x              1,4,5
    y             2                                                                                                   y               2,6
    z             3          --------------------------------------------------------->                              z                  3
    x             4          (  this should be converted into another
    x             5             list when i enter values )
    y             6


in my web page  i have two list of tables,  when i enter  the values in first tables, the values should be reflected in second table i,e  i need to get my distinct. (product)....

i need the logic in jquery....please help,