Created
November 27, 2011 14:04
-
-
Save devboy/1397601 to your computer and use it in GitHub Desktop.
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 multiply( x: Float, y: Float ): Float | |
{ | |
return x * y; | |
} | |
// now we create a partial function, with a preset parameters | |
var multiplyByTen = Funk.partial( multiply, 10 ); | |
// now we can call multiplyByTen to multiply a number by ten | |
var num = multiplyByTen(5); // num = 50 | |
// the created function multiplyByThen does actually look like this: | |
function multiplyByTen(p0:Float):Float | |
{ | |
return multiply( 10, p0 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment