mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
doing step 4 demo notes
This commit is contained in:
@@ -1 +1,13 @@
|
||||
// Place your implementation from Step 2-01 exercise here
|
||||
export class Stack<T> {
|
||||
private _items: T[] = [];
|
||||
|
||||
push(item: T) {
|
||||
this._items.push(item);
|
||||
}
|
||||
|
||||
pop(): T {
|
||||
if (this._items.length > 0) {
|
||||
return this._items.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user