- The array that will be passed as argument will always have exactly 2 elements:
- The first element - a floating-point number that will represent the width of the rectangle.
- The second element - another floating-point number that will represent the height of the rectangle.
- Output a single line - the rectangle's area and perimeter, separated by a whitespace.
- Print the area and perimeter values with exactly 2-digits precision after the floating point.
- You can use
console.logto print the results or you can use
returnto return the answer. Both are correct.
- The width and height will always be valid floating-point numbers.
- Time limit: 0.2s
- Memory limit: 16MB
Sample test 1
[ '2.5', '3' ]
Sample test 2
[ '5', '5' ]
Sample test 3
[ '3', '4' ]
- Submit your code here