Hey there! I have a Uint8Array
that looks like this:
var ar = new Uint8Array();
ar[0] = 'G';
ar[1] = 0x123;
The value at the second index is a hexadecimal number, and I want to check if ar[1]
is greater than zero. So I wrote this code:
if(ar[1] > 0){
console.log("OK");
}
else{
console.log("NOP")
}
However, when I try to output console.log(ar[1])
, I get 'undefined'. Check out this simple JSBin I created.