Created
July 25, 2019 15:39
-
-
Save amiralies/a019828ce6686d7ccb4df8fd03880dce to your computer and use it in GitHub Desktop.
Revisions
-
amiralies created this gist
Jul 25, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ const filter = (obj, fun) => Object.entries(obj).reduce( (prev, [key, value]) => ({ ...prev, ...(fun(key, value) ? { [key]: value } : {}) }), {} );