<meta name="viewport" content="width=device-width">
<script id="jsbin-javascript">
Stack.prototype.push = function (val) {
if (this.storage.length === 0) {
this.storage = this.storage + '---' + val;
Stack.prototype.pop = function () {
var items = this.storage.split('---');
this.storage = items.join('---');
Stack.prototype.size = function () {
return this.storage.split('---').length;
var myWeeklyMenu = new Stack();
myWeeklyMenu.push('Red Beans');
myWeeklyMenu.push('Ranch Skillet');
console.log(myWeeklyMenu.storage);
console.log(myWeeklyMenu.size());
var meal = myWeeklyMenu.pop();
<script id="jsbin-source-javascript" type="text/javascript">function Stack () {
Stack.prototype.push = function (val) {
if (this.storage.length === 0) {
this.storage = this.storage + '---' + val
Stack.prototype.pop = function () {
const items = this.storage.split('---')
this.storage = items.join('---')
Stack.prototype.size = function () {
return this.storage.split('---').length
const myWeeklyMenu = new Stack()
myWeeklyMenu.push('Red Beans')
myWeeklyMenu.push('Ranch Skillet')
console.log(myWeeklyMenu.storage)
console.log(myWeeklyMenu.size())
const meal = myWeeklyMenu.pop()
console.log(meal);</script></body>