# Challenge 2: Famous Writers

Did you know you can also have an array of objects? We've created one for you here. Loop through the array, and for each object, `console.log()` the following sentence:

```javascript
"Hi, my name is {firstName} {lastName}. I am {age} years old, and work as a {occupation}."
```

Ignore the brackets. They're just there to let you know a word should be replaced with something else. The sentence you log should look like this:

```javascript
"Hi, my name is Virginia Woolf. I am 59 years old, and work as a writer."
```

Here is the array:

```javascript
var writers = [
  {
    firstName: "Virginia",
    lastName: "Woolf",
    occupation: "writer",
    age: 59,
    alive: false
  },
  {
    firstName: "Zadie",
    lastName: "Smith",
    occupation: "writer",
    age: 41,
    alive: true
  },
  {
    firstName: "Jane",
    lastName: "Austen",
    occupation: "writer",
    age: 41,
    alive: false
  },
  {
    firstName: "bell",
    lastName: "hooks",
    occupation: "writer",
    age: 64,
    alive: true
  },
];
```

If you want an extra challenge, only `console.log()` the writers that are alive.[<br>](https://node-girls.gitbook.io/tutorials/~/drafts/-LHS9Z9LAjRfFBmBArrY/primary/javascript-for-beginners/challenges/challenge-1-age-difference)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://node-girls.gitbook.io/beginners-javascript/challenges/challenge-2-famous-writers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
