Siebel eScript Language Reference > Methods Reference > Array Methods >

Delete Last Array Element Method


The Delete Last Array Element method does the following work:

  1. Gets the length of the current Array object.
  2. If the length is defined or is not 0, then it does the following:
    1. Returns the last element.
    2. Deletes the last element.
    3. Decreases the length of the current array object by one.
  3. If the length is undefined or is 0, then it returns an undefined value.

The Delete Last Array Element method works on the end of an array. You must use the Array Shift method to work on the beginning of an array.

Format

arrayName.pop()

Example

The following example includes the Delete Last Array Element method:

var a = new Array( "four" );
TheApplication().RaiseErrorText("First pop: " + a.pop() + ", Second pop: " + a.pop());
// First displays the last (and only) element, the string "four".
// Then displays "undefined" because the array is empty after
// the first call removes the only element.

Siebel eScript Language Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.