Whatever message this page gives is out now! Go check it out!
Parameter | Description |
array | Name of the array that you want to slice. |
offset | Specifies the position from which to slice the array. Negative value indicates that the array is sliced, with sequence starting from array's end. |
length | Element count from offset. |
<cfscript>
array = [1, 2, 3, 4, 5, 6, 7, 8];
newArray = arraySlice(array, 2, 3);//returns 2,3,4
writeDump(newArray);
newArray = arraySlice(array, 4);//returns 4,5,6, 7, 8
writeDump(newArray);
newArray = arraySlice(array, -5, 3);//returns 4,5,6
writeDump(newArray);
</cfscript>