Skip to content

Instantly share code, notes, and snippets.

@jamc92
Created February 22, 2015 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamc92/d3b9fe225ecff7f71fab to your computer and use it in GitHub Desktop.
Save jamc92/d3b9fe225ecff7f71fab to your computer and use it in GitHub Desktop.
JS - Return Function
<!DOCTYPE html>
<html>
<head>
<title>Return Function</title>
<script>
function circleArea(r) {
this.r = r;
return 3,1416 * (r * r);
}
</script>
</head>
<body>
<script>
var r = r
var result = circleArea(8);
document.write("El radio del circulo es: " + r + " y su area es: " + result) </script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment