Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function circleArea(input) {
- let result = 0;
- let inputType = typeof (input);
- if (inputType === 'number') {
- result = Math.pow(input, 2) * Math.PI;
- console.log(result.toFixed(2));
- } else {
- console.log(`We can not calculate the circle area, because we receive a ${inputType}.`)
- }
- }
- circleArea([5]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement