0
オブジェクトの配列であるmenuProduitSet []、 を押した後に 'menuProduit'オブジェクトのオブジェクトです 重複するオブジェクトをどのように削除できますか?javacriptを使用して配列から重複するオブジェクトを削除します
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);
}
}
});
http://stackoverflow.com/questions/2218999/remove-duplicates-from-an-array-of-私が1つのオブジェクトに3つのオブジェクトを持っているので、オブジェクト内のJavaScriptは –
では機能しません –