Last active
August 29, 2015 14:06
-
-
Save is8r/521fb9443b10023e953b to your computer and use it in GitHub Desktop.
オブジェクトの配列から特定の値を持っているオブジェクトを削除する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function filterKeyDelete(key, attr, ar) { | |
return function(i, index){ | |
if (i[key] == attr) ar.splice(index, 1); | |
}; | |
} | |
//howto | |
array.filter(filterKeyDelete('count', 1, array)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment