Question 1 of 30
In a JavaScript application designed to manage a library\'s book collection, you need to create an array to store the titles of the books. You want to initialize this array with five book titles, ensuring that the titles are stored in a way that allows for easy retrieval and manipulation. Which of the following methods correctly creates and initializes the array with the titles \"The Great Gatsby\", \"1984\", \"To Kill a Mockingbird\", \"Pride and Prejudice\", and \"Moby Dick\"?
`let books = ["The Great Gatsby", "1984", "To Kill a Mockingbird", "Pride and Prejudice", "Moby Dick"];`
`let books = new Array("The Great Gatsby", "1984", "To Kill a Mockingbird", "Pride and Prejudice", "Moby Dick");`
`let books = Array("The Great Gatsby", "1984", "To Kill a Mockingbird", "Pride and Prejudice", "Moby Dick");`
`let books = new Array(); books[0] = "The Great Gatsby"; books[1] = "1984"; books[2] = "To Kill a Mockingbird"; books[3] = "Pride and Prejudice"; books[4] = "Moby Dick";`

Preparing for Microsoft 98-382 Introduction to Programming Using JavaScript? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free