Chapter 3: Language Essentials

Return to Chapter 3

 

To use this script on your own page, click in the text area below, select all, and copy to grab the script. Then, just paste into your own page — and you're done.

Handling Errors

See it run: Handling Errors

Script 3.12

This JavaScript contains a type of conditional that allows you to check against multiple possibilities.

Script 3.13

This script uses the JavaScript's try/throw/catch commands to handle any user errors with a square root calculator.