My instructor defines a class with the following:
function Stack () {
var items = [];
getItems() {
return items;
}
The question I have is how to define a method within the function Stack?
The exact instruction is as follows:
// 1. Implement the stack data structure described in the book. Instead of
// using let items = []; use var items = []. Note that this
// implementation does not use the prototype (see project).
function Stack() {
}
