The constructor initializes an array of elements, which can be provided as an optional parameter.
Optional
elements: E[]The elements
parameter is an optional parameter of type E[]
, which represents an array
of elements of type E
. It is used to initialize the _elements
property of the class. If the elements
parameter
is provided and is an array, it is assigned to the `_elements
Protected
_elementsStatic
fromThe function "fromArray" creates a new Stack object from an array of elements.
The elements
parameter is an array of elements of type E
.
The method is returning a new instance of the Stack class, initialized with the elements from the input array.
Generated using TypeDoc
License
MIT
Copyright
Tyler Zeng zrwusa@gmail.com