There are to methods being used in the zipCodeCheck() function, they are .some() and .includes() .
.some() is a native method that check for items in an array. It goes through the array items, trying to find whatever you tell it to find, and returns either true or false .
.includes() is a method that checks if a collection of characters is included in a string, partially or not, and also returns true or false .
So the function mentioned above goes from item to item in the array, and on each item, tries to find the string defined in the input.
Upon writing this message, I noticed an error, you should change something to include partial results. This is the correct version:
$w("#buttonVerify").onClick(() => {
const searchZipCode = $w("#inputZipCode").value //Puts the input value inside a variable
const zipCodeCheckResult = zipCodeCheck(searchZipCode)
if (zipCodeCheckResult) $w("#button2").show()
else $w("#text1").show()
})
function zipCodeCheck(zipCode) {
const checkArrayResult = arrayOfZipCodesAllowed.some(item => zipCode.includes(item)) //This was inverted on the code.
return checkArrayResult
}