format
typescript
Stack.Swap(rhs)class: Stack
description
Swaps the elements of the current stack with the elements of the target stack.
parameter
| param_name | type | description |
|---|---|---|
| rhs | Stack<T> | The target stack. |
reture
| type | description |
|---|---|
void |
code example
typescript
let stack = new Stack<Number>();
stack.Push(1);
stack.Push(2);
stack.Push(3);
let rhs = new Stack<Number>();
rhs.Push(4);
rhs.Push(5);
rhs.Push(6);
// Swaps the elements of the current stack with the elements of the target stack.
stack.Swap(rhs);