Created
October 20, 2013 20:46
-
-
Save cmarkle27/7075092 to your computer and use it in GitHub Desktop.
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="[add your bin description]" /> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains 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 powerFactory(pow){ | |
return function(num){ | |
var result = 1; | |
for (var i=0; i<pow; i++){ | |
result *= num; | |
} | |
return result; | |
}; | |
} | |
var powThree = powerFactory(3); | |
console.log(powThree(2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment