i have an array of object menuProduitSet[] , after pushing to it 'menuProduit' which is object of object how can in remove duplicate objects ???
var menuProduitSet = [];
$('select').children('optgroup').children('option:selected').each(function () {
var ch = $(this).parent().parent().parent().parent().attr('class').substring(4, 5);
if (ch !== 'undefined') {
if (ch !== 'c') {
var produit = {"prodId": $(this).val()};
var menuProduit = {menuProduitPK: {menu: menu["menuId"], produit: produit["prodId"], choix: ch}, menu: {menuId: menu["menuId"]}, produit: {prodId: produit["prodId"]}};
menuProduitSet.push(menuProduit);
}
}
});