Question

Basically, since XMLList are similar to Arrays in many ways, I was wondering if I could do something like:

XMLList.length = 10;

I know this is not possible because 'length' in XMLList is not a property but is a method. Hence is something like a get method without a set method. Only XMLList.length() would work.

But is there a workaround. An easier one.

I know this can be done with loops or by converting the XMLList to Array, cutting off and converting it back to XMLList. I'd like to know if there's an easier way.

Was it helpful?

Solution

while (xmlList.length() > 10)
{
    delete(xmlList[10]);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top