Javascript shift() unshift() mnemonics? [closed]

As I known.

The shift command is come from the binary bit shift [1]. for Example.

    001100
0 < 011000 // when you shift left
|
Yay!

I think it is quite simple it is just like you push it from behind. So this makes sense for me.

The unshift is the opposite way of shift.

    001100
1 > 001100 // they called it unshift
    1001100
    |
    Yay!

So that’s it, Hope this helps!

[1] http://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)