How can I compare two the same types against each other in JavaScript?
So a == b
should return true, because they are both arrays
.
So it doens't matter what the contents of the variable are. The comparison should be something like this;
var a = [];
var b = [];
var c = "this is a string";
var d = "this is also a string";
if(a type == b type) // true because both arrays
if(c type == d type) // true because both strings
if(a type == d type) // false because not the same type (string) or (array)