Currently immersed in javascript the good parts, I stumbled across an interesting example by the author:
['d','c','b','a'].sort(function(a,b) {
return a.localeCompare(b);
});
The expected behavior was observed. Intrigued, I attempted to take it one step further with this code - the next logical progression:
['d','c','b','a'].sort(String.prototype.localeCompare.call);
However, this resulted in an error:
TypeError: object is not a function
This leaves me pondering the reason behind it... Any thoughts or insights on this?