# Learn Basic JavaScript by Building a Role Playing Game - Step 116

**URL:** <https://forum.freecodecamp.org/t/learn-basic-javascript-by-building-a-role-playing-game-step-116/658860>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [December 27, 2023, 3:43pm UTC](https://forum.freecodecamp.org/t/learn-basic-javascript-by-building-a-role-playing-game-step-116/658860 "2023-12-27T15:43:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lagonebula](https://avatars.discourse-cdn.com/v4/letter/l/b38774/32.png) [@lagonebula](https://forum.freecodecamp.org/u/lagonebula)\
**Post date:** [December 27, 2023, 3:43pm UTC](https://forum.freecodecamp.org/t/learn-basic-javascript-by-building-a-role-playing-game-step-116/658860/1 "2023-12-27T15:43:52Z")

</div>

### Tell us what’s happening:

 ![Screenshot 2023-12-27 at 16.40.52](https://global.discourse-cdn.com/freecodecamp/original/4X/c/9/1/c9180af50b637f95bdcd651910a8088a3d8b36c6.png)

What’s the monsterHealth variable? I’ve tried several combinations and still I can’t solve it. I need some help.

### ### Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

```auto
function goFight() {
  update(locations[3]);
  monsterHealth = monsters[fighting];
}

```

### Your browser information:

User Agent is: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 OPR/105.0.0.0`

### Challenge Information:

Learn Basic JavaScript by Building a Role Playing Game - Step 116

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/step-116)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![robheyays](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/robheyays/32/381866_2.png) [@robheyays](https://forum.freecodecamp.org/u/robheyays)\
**Post date:** [December 27, 2023, 4:21pm UTC](https://forum.freecodecamp.org/t/learn-basic-javascript-by-building-a-role-playing-game-step-116/658860/2 "2023-12-27T16:21:23Z")

</div>

Hello, your very close to solving this, all that is missing is .health

**Generative AI is experimental**. [Learn more](https://support.google.com/websearch?p=data_genai_search&hl=en)

In JavaScript, dot notation is a way to access the properties of an object. For example, if you have an object called `person` with a property called `name`, you would access the `name` property using `person.name`.

You can also use dot notation to call methods on an object. For example, if you have an object called `calculator` with a method called `add`, you would call the `add` method using `calculator.add()`.

Dot notation is a very convenient way to access the properties and methods of objects. It is also very easy to read and understand.

---

<div class="post-metadata">

**Author:** ![pkdvalis](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/pkdvalis/32/350571_2.png) [@pkdvalis](https://forum.freecodecamp.org/u/pkdvalis)\
**Post date:** [December 27, 2023, 4:21pm UTC](https://forum.freecodecamp.org/t/learn-basic-javascript-by-building-a-role-playing-game-step-116/658860/3 "2023-12-27T16:21:56Z")

</div>

> You can get this value by accessing the `health` property of `monsters[fighting]` with dot notation.

Need to add this part

---

<div class="post-metadata">

**Author:** ![lagonebula](https://avatars.discourse-cdn.com/v4/letter/l/b38774/32.png) [@lagonebula](https://forum.freecodecamp.org/u/lagonebula)\
**Post date:** [December 27, 2023, 9:31pm UTC](https://forum.freecodecamp.org/t/learn-basic-javascript-by-building-a-role-playing-game-step-116/658860/4 "2023-12-27T21:31:15Z")

</div>

Solved. Thank you so much for the feedback!

---

<div class="post-metadata">

**Author:** ![lagonebula](https://avatars.discourse-cdn.com/v4/letter/l/b38774/32.png) [@lagonebula](https://forum.freecodecamp.org/u/lagonebula)\
**Post date:** [December 27, 2023, 9:32pm UTC](https://forum.freecodecamp.org/t/learn-basic-javascript-by-building-a-role-playing-game-step-116/658860/5 "2023-12-27T21:32:10Z")

</div>

Thank you for mentioning this, it was very helpful too!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [June 27, 2024, 9:32am UTC](https://forum.freecodecamp.org/t/learn-basic-javascript-by-building-a-role-playing-game-step-116/658860/6 "2024-06-27T09:32:27Z")

</div>

Closed on June 27, 2024, 9:32am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
