Skip to content

Instantly share code, notes, and snippets.

@cmarkle27
Created October 20, 2013 20:46
Show Gist options
  • Save cmarkle27/7075092 to your computer and use it in GitHub Desktop.
Save cmarkle27/7075092 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>
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