I got two kinds of items by different routes, with the result that their constructors are Listitem() and String(). They both look identical when printed out in the debug window, but they do not satisfy an == equality test. I've tried things like:
1. Convert one or the other to strings using toString()
2. Put the string into a list and then take it out - it's still a string! Here's the code I used
// x is the one whose constructor is Listitem
// y is the one whose constructor is string
// First approach
x == y
x.toString() == y
x.toString() == y.toString()
z = 
z.push(y) //hoping to make the string into a list item
v = z //if you look after this, it's still a string!!!!
x == v
None of these work. How does one get across this artificial boundary to show them matching?
Thanks in advance...
If you know that x is a ListItem and y a String, then x.text == y should be your comparison test, shouldn't it?
that did work. Actually what was happening behind the scenes is that I was so frustrated about my big script not working for a demo last night that I changed the result return from the searching loop incorrectly, so the fact that the matching did work was hidden by the error in the return values from the function. Thanks for getting me to look with "new eyes."