implement stack in js+c