Skip to content

Instantly share code, notes, and snippets.

@ddeveloperr
Last active January 13, 2016 19:49
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 ddeveloperr/a50fe81a06e97d1e8645 to your computer and use it in GitHub Desktop.
Save ddeveloperr/a50fe81a06e97d1e8645 to your computer and use it in GitHub Desktop.
JavaScript allows you to place functions anywhere in your file
// WHY JavaScript allows you to place functions anywhere in your file
// Link to my blog: https://ddeveloperrblog.wordpress.com/2016/01/13/why-javascript-allows-you-to-place-functions-anywhere-in-your-file/
var radius = 9;
var myCircleArea = circleArea(radius);
console.log(myCircleArea);
function circleArea(r) {
var a = Math.PI * r * r;
return a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment