IE why would code like
var strArr = ["a", "b"];
console.log(strArr.reverse() === strArr ? true : false);
print true if the reversed array has a different order?
Actually the Array.prototype.reverse() method morphs the original array to it's reverse and then in addition to that returns a "reference" to this morphed array. Hence the result and the morphed original array becomes the same.
If anyone had asked me before developing this method i would request to keep the original as it is and return a reversed array; alas apparently it wasn't my call.
===already returns a boolean.[0,1,2] === [0,1,2]--> false, since===returns true for operands of type object, only if they reference the same object. Contents aren't considered.