Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
167
rated 0 times [  173] [ 6]  / answers: 1 / hits: 188936  / 14 Years ago, sun, december 19, 2010, 12:00:00
var functor=function(){
//test
}

functor.prop=1;

console.log(functor);


this only show the function part of the functor, cannot show the properties of the functor in console.


More From » debugging

 Answers
80

Use console.dir() to output a browse-able object you can click through instead of the .toString() version, like this:



console.dir(functor);



Prints a JavaScript representation of the specified object. If the object being logged is an HTML element, then the properties of its DOM representation are printed [1]







[1] https://developers.google.com/web/tools/chrome-devtools/debug/console/console-reference#dir


[#94551] Thursday, December 16, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
zachary

Total Points: 175
Total Questions: 89
Total Answers: 108

Location: Fiji
Member since Wed, Jul 14, 2021
3 Years ago
;