Array methods

Array.prototype.push8 = function (num) {
    this.push(num & 0xFF);
};

Array.prototype.push16 = function (num) {
    this.push((num >> 8) & 0xFF,
              (num     ) & 0xFF  );
};
Array.prototype.push32 = function (num) {
    this.push((num >> 24) & 0xFF,
              (num >> 16) & 0xFF,
              (num >>  8) & 0xFF,
              (num      ) & 0xFF  );
};

今天看了这个代码不知道是干嘛的,看到了 stackoverflow 上的回答,仍旧没有理解作用是什么?什么时候用?不知道哪一位大神知道可以解释一下!

在 github 上看到貌似是关于 noVNC 的。

你可能感兴趣的:(Array methods)