Skip to content

Instantly share code, notes, and snippets.

@DavidGoussev
Forked from anonymous/index.html
Created June 10, 2016 23:04
Show Gist options
  • Select an option

  • Save DavidGoussev/35deb8a033e10c52f0be4b5463422fb9 to your computer and use it in GitHub Desktop.

Select an option

Save DavidGoussev/35deb8a033e10c52f0be4b5463422fb9 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/menoneteqa
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
function pow(base, exp){
var newbase = 1;
for(i=1; i <= exp; i++) {
newbase *= base;
}
return newbase;
};
console.log(pow(2,1));
console.log(pow(2,2));
</script>
<script id="jsbin-source-javascript" type="text/javascript">function pow(base, exp){
var newbase = 1;
for(i=1; i <= exp; i++) {
newbase *= base;
}
return newbase;
};
console.log(pow(2,1));
console.log(pow(2,2));</script></body>
</html>
function pow(base, exp){
var newbase = 1;
for(i=1; i <= exp; i++) {
newbase *= base;
}
return newbase;
};
console.log(pow(2,1));
console.log(pow(2,2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment