function swap() {
    const last = this.stack.length - 1;
    const temp = this.stack[last];
    this.stack[last] = this.stack[last - 1];
    this.stack[last - 1] = temp;
}
/**
 * Swap top two stack elements.
 */
Swap top two stack elements.
Swap top two stack elements .
function swap() {
    const last = this.stack.length - 1;
    const temp = this.stack[last];
    this.stack[last] = this.stack[last - 1];
    this.stack[last - 1] = temp;
}
function swap ( ) { const last = this . stack . length - 1 ; const temp = this . stack [ last ] ; this . stack [ last ] = this . stack [ last - 1 ] ; this . stack [ last - 1 ] = temp ; }
Swap top two stack elements.
Swap top two stack elements .