To implement your stack and queue you can use a simple array. The array object in javascript has commands like push(sth) or pop().
For more informations, take a look @ http://www.w3schools.com/js/js_obj_array.asp
Also check this out: How do you implement a Stack and a Queue in JavaScript?.
I hope you can start from here. learning by doing is the best way to learn sth. ;)