loading...

re: Creating 3 Stacks With 1 Array in JavaScript VIEW POST

FULL DISCUSSION
 

Excellent article!

Just one question:
In push method, shouldn't be

this.values[this.indexOfTop(stackNumber) + 1] = value;

instead of

this.values[this.indexOfTop(stackNumber)] = value;

?

Code of Conduct Report abuse