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

Hello,
I do not quite understan the insrtructions of step 124.
I have tried several combinations even though it does not seem too complicated.

Instructions:
Using these, you can generate a random number within a range. For example, this generates a random number between 1 and 5: Math.floor(Math.random() * 5) + 1;.

Following this pattern, use the addition operator (+) to add a random number between 1 and the value of xp to your monsterHealth -= weapons[currentWeaponIndex].power.

One refused solution:
monsterHealth -= weapons[currentWeaponIndex].power + (Math.floor(Math.random() * xp) + 1);

The comment:
You should add the result of Math.floor(Math.random() * xp) + 1 to the result of weapons[currentWeapon].power .

Another:
monsterHealth -= weapons[currentWeaponIndex].power weapons[currentWeapon].power += (Math.floor(Math.random() * xp) + 1);

Thank you in advance for your help.

hi there!
also post your code and link to the step.

only need currentWeapon

[currentWeapon]

above is the currentWeapon index.

Thank you so much for your reply.
The link is: https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/step-124

The problem is that with all these micro-instructions, I do not have the overall vision of what needs to be achieved.

monsterHealth -= weapons[currentWeaponIndex].power;
 weapons[currentWeapon] += (Math.floor(Math.random() * xp) + 1);

That too is wrong!

this without the parenthesis that are not needed seems a good solution

Thank you so much but… this is the response:
You should add the result of Math.floor(Math.random() * xp) + 1 to the result of weapons[currentWeapon].power .

show me your code please

Thank you.

Here is the code:
monsterHealth -= weapons[currentWeaponIndex].power + (Math.floor(Math.random() * xp) + 1);

and that’s the response:
You should add the result of Math.floor(Math.random() * xp) + 1 to the result of weapons[currentWeapon].power .

as I said, remove the parenthesis you can do without

Thank you, ilenia, that was it.
Grateful for your kind help!