What does the “free” function `toString` (at global scope, not called as a method) do?
19:41 25 Jan 2013

OK I just did it and scratched my head for a while. I tried following on my Chrome console:

var a = [];
toString.call(a); //[object Array]
a.toString(); //""
toString(a); //[object Object] I know it's blunder but still!

What is difference between the toString and .toString I definitely know they are from different scopes (objects), but which one should be used at what time? Why is it so messy?

javascript syntax