I came across this method Object.prototype.toString.call() to judge the type of JS object. I have understand its basic usage, but want to be able to understand more at the bottom. So where I can find its implementation?
Unfortunately you can't quite reverse engineer .call -- at least not as JavaScript -- simply because of how 'this" is handled or handling the multiple parameters back into actual parameters -- at least not without also reverse engineering "Function.apply". (which I always found more useful).
NOT that said command has ANYTHING to do with "judge the type of the JS object"... I have ZERO clue what you even mean by that as that has next to nothing to do with what a .call() does.
Makes me wonder if you ACTUALLY know what it does.
Marco Alka
Software Engineer, Technical Consultant & Mentor
call()is a generic method, which can be used on any function or method. So... Wanna know howcall()is implemented in V8, Chrome's JS engine? Here and here!Though I doubt that you will be happy with reading the implementation. Maybe you can elaborate what exactly you want to know about it or what is unclear/not documented in a satisfactory fashion...