Created
March 18, 2016 06:19
-
-
Save idettman/4dc5185f8ad156e5c9b4 to your computer and use it in GitHub Desktop.
JavaScript K Combinator (Tap)
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 tap(value) | |
| { | |
| return function(fn) | |
| { | |
| if (typeof(fn) === 'function') | |
| { | |
| fn(value); | |
| } | |
| return value; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment