AnsweredAssumed Answered

JS indexOf array method PAM 04.2.02

Question asked by JR_Johnson on May 4, 2015
Latest reply on May 29, 2015 by IanRich

Hello,

 

I'm attempting to check the presence of an item in an array using the 'indexOf' method.

 

The array in question is a process dataset variable defined as an array of strings.

 

Example code:

if ((Process.idList).indexOf(Process.workingUUIDList[item].Attributes[0].Attribute[0].AttrValue[0].text_,0) >= 0) {

//do some things

}

 

This code fails with the error "-- TypeError: Cannot find function indexOf. (#5)"

 

Does the PAM JS engine for version 04.2.02 just not contain the indexOf array method?

If not, is there a similar method that I can use to check the presence or absence of a value in an array without needing to manually iterate through each item?

 

Or might there be something else entirely going on here that I'm unaware of?

Outcomes