I have a function in namespace lib.focus = function() ...
This shows in the chrome debugger, but I need to get this as a string lib.focus
from the object...
Any idea how I can do this? When I query it, it only shows me the contents of the object.
Asked
Active
Viewed 32 times
0

Alireza Ahmadi
- 8,579
- 5
- 15
- 42

Gibbz
- 69
- 4
-
What is the expected result? Have you tried `JSON.stringify`? Have you tried getting the individual properties? – Sebastian Simon Jul 08 '21 at 05:14
-
Maybe see https://stackoverflow.com/questions/332422/get-the-name-of-an-objects-type or https://stackoverflow.com/questions/1249531/how-to-get-a-javascript-objects-class. I suspect that's what you want – Chris Lear Jul 08 '21 at 05:23
-
Thanks, Ive tried these answers with no luck. Stringify errors out, and class names etc all return either 'Object' or 'MovieClip', not 'lib.focus'. – Gibbz Jul 08 '21 at 05:35
-
1I think realistically your question is completely answered in https://stackoverflow.com/questions/332422/get-the-name-of-an-objects-type. The summary is that you can't do what you want to do using javascript. How the console manages it, I don't know. – Chris Lear Jul 08 '21 at 09:19