I’m a little new to this myself. Looks like this is a For loop. It has a few elements to it.
x = 0;
This expression creates a variable named x which is initially set to 0.
Each time the body of the loop executes, the value of x increases by 1.
x < array.length
The for loop will continue to run until the value of x becomes equal to the length of the array. So for example, consider the simple array [1, 2, 3, 4, 5]. The length of that array is 5. So the loop mentioned about would run 5 times in total. The first time, x would be equal to 0. Then it is increased by 1 so the second time the loop runs it is equal to 1. The third time, 2. Fourth, 3. Fifth, 4. Then before running the body of the loop for a sixth time, it will check that x is less than 5. It is no longer less then 5 so the loop terminates which is just as well because we’ve reached the end of the array.
if (array === item)
Finally, the actual body of the loop. It checks to see if each instance of “array” is equal to the value of “item”. If it is equal, it returns the value “true” meaning, this item exists in this array of values. If the for loop completes without finding the value in the array, it returns false, meaning this item does not exist in this array of values.
I hope that helps.