Created
February 26, 2018 09:28
-
-
Save kru/8e67b90b39bd29e733a44e02219e7832 to your computer and use it in GitHub Desktop.
Revisions
-
kru created this gist
Feb 26, 2018 .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,21 @@ var myAwesomeModule = (function(members) { function change() { publicAPI.showMember = removeFalsy; } function getMembers() { console.log(members); } function removeFalsy() { var truthMember = members.filter(x => !!x); console.log(truthMember); } var publicApi = { showMember: getMembers, change: change }; return publicAPI; })(['', 1, 2, null, 4, undefined, 5])