2

多次元 JavaScript オブジェクトから項目を値で削除する必要があります。たとえば、次のオブジェクト ツリーがあります (スクリーンショットには一部しか含まれていません): https://dl.dropboxusercontent.com/u/13057084/files-tree.png

ここに画像の説明を入力

「ファイル」の値でアイテムを削除する必要があるため、たとえばスクリーンショットのツリーから「9RuOxSPnTR-i_1.jpg」というファイルを削除する必要があります。

私はこれを使用しようとしました:

$.each(files, function (index_folder,folder) { // foreach files as folders
  $.each(folder, function (index_file,file_data) { // foreach folders as files (index_file = numeric index key of file)    
    delete files[index_folder][index_file];
  });
});
4

2 に答える 2