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.'; } }
—from Throw, a other by http://www.javascriptbook.com
Active since October 4, 2018.
301 total characters in this text.
View Pit Stop page for this text
Universe | Races | Average WPM | First Race |
---|---|---|---|
Coder Edition | 5,378 | 48.21 | October 4, 2018 |