• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Quiz

Test your knowledge of JavaScript strings and arrays by answering the following questions.

Questions

1:If the string test contains the value The eagle has landed., what would be the value of test.length?
  1. 4

  2. 21

  3. The

A1: b. The length of the string is 21 characters.
2:Using the same example string, which of these statements would return the word eagle?
  1. test.substring(4,9)

  2. test.substring(5,9)

  3. test.substring("eagle")

A2: a. The correct statement is test.substring(4,9). Remember that the indexes start with 0, and that the second index is non-inclusive.
3:What does the join method of an array do?
  1. Allows a new member to join the array.

  2. Combines the array with another array.

  3. Combines the array's elements into a string.

A3: c. The join method combines the array's elements into a string.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint