I got an empty array from previously code running,and I wanted to check whether it was empty within an if statement,I used
if (emptyArr) {
//do something here.
}
at first,received some weird results,now I know that I should use if (emptyArr.length === 0 ) {}
instead,but only for curiosity,what the code block above results in?