Multiple choice technology programming languages

What is the output of the below JavaScript?


var book = "Head First JavaScript";         
alert(book.length);     

  1. 21

  2. 20

  3. 22

  4. error

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The length property returns the number of characters in the string. Counting all letters and spaces in "Head First JavaScript" yields a total of 21 characters.