When a primitive type such as a string or number is used as the this
subject in a function call (such as the first argument in either function.call() or function.apply()), the primitive type is converted to its object equivalent (for example, a string becomes a String).
For example:
var f = function(x) { return [typeof(this), typeof(x)]; }
var obj = '123'
f.call(obj, obj)
>>> ["object", "string"]
This means that "this" becomes an object (specifically a String object) while the second argument passed to call remains a primitive string and serves as the first argument to the function "f".
Although both objects are "123", there are subtle differences (for instance, they are equal with "==", but not with "===").
I have observed this behavior in Chrome and Firefox, suggesting that there may be a specific reason for it. Despite my search efforts, I have yet to find any explanation. I would appreciate any clarification on why this conversion occurs, ideally accompanied by references to documentation explaining the relevant rules.