This is not valid JS. You need something on the right side of !==. What do the instructions say you should have there?
If you have made changes to your code and it still isnât working then you need to paste your updated code in here so we can see what you did.
When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the âpreformatted textâ tool in the editor (</>) to add backticks around text.
you should not put x there, you need to write an appropriate number
how to know the appropriate number? you need to make sure that the last weapon doesnât break, how many weapons are in the inventory if it is the last weapon?
if the inventory length is 3, that means you still have 3 weapons in your ownership, and at that point none can break. instead you need to make sure that the last weapon remaining will not break. The last one.
I think there is some logic you are missing here:
you need to make sure that the last weapon doesnât broke, and protect it from the code that breaks a weapon. 3.3 is not a possible length for an array, as the number of elements is always going to be an integer.
If you count how many weapons you have when you have only the last weapon, it will be a count of 1. So you need to avoid breaking the weapon when you have one weapon in the inventory. That means that you need to check that the inventory length is not 1 to allow for the weapon to break.