Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript math pi

function calculateCircumference(radius) {
  return 2 * Math.PI * radius;
}

console.log(Math.PI);
// expected output: 3.141592653589793

console.log(calculateCircumference(10));
// expected output: 62.83185307179586
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #math #pi
ADD COMMENT
Topic
Name
2+5 =