I'm pretty new to programming with GAS and I believe that the solution should be simple. However...
An array named listWP is basically return value of some function and parsed as an argument to another function. Inside array are various strings, some marked with "c-". I need to find the first and last element with such marking. But I'm allways getting -1 as the result. The code is:
Logger.log(Array.isArray(listWP)); //returns true
var firstC=listWP.indexOf('c');
var lastC=listWP.lastIndexOf('c-');
Content of array listWP is
