0
votes

I am trying to reverse an array e.g.

<xp:text escape="true" >
        <xp:this.value><![CDATA[#{javascript:var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.reverse();}]]></xp:this.value>
    </xp:text>

but I get returned:

function:IBMJS built-in function

How can perform a reverse on array via SSJS in xpages?

1
I think it is working (as in it's reversing the contents of the array). If you return fruits.join(" "); as the result of your computed field it will show "Mango Apple Orange Banana" (See this link too. Not XPages - but same issue ibm.software.network.directory-integrator.narkive.com/i0I2h3Rp/…) - Martin Perrie
@MartinPerrie: I think your comment provides the correct answer. You should post it as such. - xpages-noob

1 Answers

0
votes

Re-posting my comment as an answer as suggested by @xpages-noob

I think it is working (as in it's reversing the contents of the array). If you return fruits.join(" "); as the result of your computed field it will show "Mango Apple Orange Banana" (See this link too. Not XPages - but same issue http://ibm.software.network.directory-integrator.narkive.com/i0I2h3Rp/array-s-reverse-method-cannot-be-used-in-tdi)