Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.rawgit.com/lodash/lodash/3.0.1/lodash.min.js"></script>
<meta name="description" content="[FPJS | Luis Atencio | Currying]">
  <meta charset="utf-8">
  <title>FPJS | Luis Atencio | Exercise 1</title>
  <script src="//cdn.jsdelivr.net/ramda/0.15.1/ramda.min.js"></script>
</head>
<body>
</body>
</html>
 
/*
  Functional Programming in JavaScript
  Author: Luis Atencio
  Function curry
*/
console.log('Function curry');
var printName = _.curry(function(first, last) {
   return [last, first].join(',');
});
// When supplied both arguments, it evaluates the function
console.log(printName('Haskell')('Curry'));
// When supplied one argument, it returns another function
console.log(printName('Haskell'));
/*
  TODO: Create an curried adder function that adds to numbers. 
*/
var add = _.curry(undefined);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
luijarpro
0viewers