added stack operation using javascript