Skip to content

Instantly share code, notes, and snippets.

@daronwolff
Created May 20, 2016 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daronwolff/20b38e0ae1df0d01ef71aa150c4d4a5a to your computer and use it in GitHub Desktop.
Save daronwolff/20b38e0ae1df0d01ef71aa150c4d4a5a to your computer and use it in GitHub Desktop.
Write a function that takes an argument and returns a function that returns that argumen
"use strict";
function identify(x) {
return function(){
return x;
}
}
var idf = identify(3);
idf(); // 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment