Basic Javascript Stack without array