undefinedfix
Sign in

Why is the result of printing out the whole buffer array different from that of looping out the array members

GertVW edited in Fri, 25 Nov 2022
var bin = fs.readFileSync(pathname);  
console.log(bin)  
for (let i = 0; i < bin.length; i++) {  
  console.log(bin[i])  
}

The printing result is as follows: < buffer 31 32 33 74 65 73 74 0d 0A > 49504950511161011151161310

1 Replies
eppvp
commented on Fri, 25 Nov 2022

One is hexadecimal and the other is decimal