Intro to JavaScript Arrays You Do
Let’s practice creating, modifying, and iterating over an array of strings!
- Assign an empty array to a variable named
books. - Add ‘The Shining’ and ‘Pride and Prejudice’ or 2 other books of your choice to the
booksarray. console.log()the second element ofbooks.- Update the second element by assigning to it ‘Dune’ or another book of your choice.
- Iterate over the entire
booksarray andconsole.log()each book string.