address.trans returns [] when theres no transactions pend
if(txs === []){
returns a transaction still
Any solutions? Basically registering a "depo" when I never depo’d to the generated wallet.enter image description here
>Solution :
This should be happening because an array is an object. And two objects even with the same value are not equal in JS because they have different reference.
You can see that below:
let trans = [];
console.log(trans === []);
console.log([] === []);
console.log(trans.length === 0);
Array.prototype.length can be one way to check it: