debugging - logging function/objects name's in javascript inside of a function stack -


Learning JS is a bumpy road ... I have to understand what happens inside my code, so is Console

From time to time, I do not even know where the errors came from (or I might still be dumb), I thought better to enter my app stack I did this simple now The complex problem :

tried to find an answer for how to do console.log () < P> For example name of console.log is being addressed to the g> function (constructor). Problematic:

  function SomeFunction (argument1, argument2) {console.log (this + '& gt; 01 message'); Console.log (this.name + '& gt; 02 Message'); Console.log (this.constructor + '& gt; 03 Message'); Console.log (this.constructor.name + '& gt; 04 Message'); Console.log (this. Prototype + '& gt; 05 message'); Console.log (this.constructor.method + '> message 06); } SomeFunction.prototype.sayHello = function (} {console.log (called this ''> 01 Hello '); console.log (this.name +'> say hello 02); console.log (This.constructor + '& gt 03; hello';;; and so on ...}   

So who's right? SomeFunction.constructor.name < / Code> is working, but this syntax is quite long to use each, so

var fn = this.constructor.name makes some sense, But this is only disabled.

Someone can tell me in the direction of good behavior, I will log the correct logs with my code. How can I squeeze information?

FYI : I searched many books about this simple subject, and neither did anyone say anything about it.

Use developer tools (F12, control-eye) or enjoy a single - via your code, the variable Analyze, and make changes, edit CSS, this will dramatically improve your Javascript learning experience ...

Comments