Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. function circleArea(input) {
  2. let result = 0;
  3. let inputType = typeof (input);
  4. if (inputType === 'number') {
  5. result = Math.pow(input, 2) * Math.PI;
  6. console.log(result.toFixed(2));
  7. } else {
  8. console.log(`We can not calculate the circle area, because we receive a ${inputType}.`)
  9. }
  10. }
  11.  
  12. circleArea([5]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement