Tell us what’s happening:
Dear Friends, i do not understand how the value of fighting in slime and other monster being fought represent the index of the in monsters arrays, why should it not be
fighting = monsters[0]; to indicate the index in array instead of
fighting = 0;
Why are we not using bracket notation.
I have passed this level but i have fail to understand something about the index number.
I will really appreciate Your explanation . Thank you.
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
function fightSlime() {
fighting = 0;
}
// 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/126.0.0.0 Safari/537.36
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 112