fn.apply with first param null or undefined
I am confused with
Consider this snippet
I can grasp this. I understand fn.apply as,
But the below snippets also work
MDN explains this as,
I don’t really understand the part which I have made bold. What is the meaning of that statement? Could anyone elaborate a bit?
The “global object” is the global object. Just read the spec:
In the browser, you’re essentially calling
This is one of the many problems with non-strict mode.
“Primitive values will be boxed” just says that primitives like numbers and strings will be “boxed” into a container object because primitives themselves are not objects. Again, you can verify this: