Record your races with a typeracer account:
Create Your Account- Save your race history and scores.
- Customize your profile and racecar.
- It’s free, why not?
Race Result Details |
Racer | Enock (enockmutanga01) |
Race Number | 21 |
Date | Fri, 8 Sep 2023 08:30:51 +0000 |
Universe | code |
Speed | 21 WPM Try to beat? |
Accuracy | 91.8% |
Rank | 2nd place (out of 3) |
Text typed:
function calculateArea(width, height) {
try {
var area = width * height;
if (!isNaN(area)) {
return area;
} else {
throw new Error('calculateArea() received invalid number');
}
} catch(e) {
console.log(e.name + ' ' + e.message);
return 'We were unable to calculate the area.';
}
}
— Throw
(other)
by http://www.javascriptbook.com
(see stats)
|