Tell us what’s happening:
do i add dot notation inside the bracket here. I have read up on this but still a bit confused
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
function goFight() {
update(locations[3]);
monsters[fighting];
}
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 115
1 Like
a2937
April 29, 2024, 3:28pm
2
Hi there. In regards to dot notation, this challenge wants to you to retrieve the health
property from the monster you’re currently fighting and assign to the predefined monsterHealth
variable. The monster being stored at the fighting
index inside of the monsters
array is the current monster.
Hope this helps.
Here is an article with more examples on how to access properties from an array of objects
When you're working with JavaScript applications, it's common to work with arrays, nested arrays, and an array of objects. But a lot of beginners sometimes struggle with knowing how to access properties from these different data structures. In this...
1 Like
system
Closed
October 29, 2024, 3:29am
4
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.