Intro to JavaScript Arrays You Do

Let’s practice creating, modifying, and iterating over an array of strings!

  1. Assign an empty array to a variable named books.
  2. Add ‘The Shining’ and ‘Pride and Prejudice’ or 2 other books of your choice to the books array.
  3. console.log() the second element of books.
  4. Update the second element by assigning to it ‘Dune’ or another book of your choice.
  5. Iterate over the entire books array and console.log() each book string.