What do “>>” and “<<” mean in Javascript?

后端 未结 10 827
清酒与你
清酒与你 2020-11-29 13:39

I have a piece of Javascript code I\'m trying to understand

// read big-endian (network byte order) 32-bit float
readFloat32 = function(data, offset) {
    v         


        
10条回答
  •  抹茶落季
    2020-11-29 13:53

    You can read about the operators here: https://developer.mozilla.org/en/JavaScript/Reference/operators/bitwise_operators

    They are bit shifts and also occur in languages other than JS.

    Example: 5 >> 1 = 2

    binary: 0101 shifting one position = 0010

提交回复
热议问题