Last active
December 13, 2015 18:38
-
-
Save malavv/4956399 to your computer and use it in GitHub Desktop.
Blog_#3_Closure_Ex_Js
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
// JavaScript | |
var CompareWith = function(comparator) { | |
return function(elem) { return comparator == elem; }; | |
} | |
var compareWith3 = CompareWith(3); | |
console.log(compareWith3(3) + " " + compareWith3(4)); | |
// Prints - true false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment