code: function equals(x, y) {
    var i;
    var k=x.length<y.length ? x.length : y.length;
    for (i=0; i<k; i++)
      if (x[i]!=y[i])
        return 0;
    if (x.length>y.length) {
      for (;i<x.length; i++)
        if (x[i])
          return 0;
    } else {
      for (;i<y.length; i++)
        if (y[i])
          return 0;
    }
    return 1;
  }
docs: are bigints x and y equal? this works even if x and y are different lengths and have arbitrarily many leading zeros