Reputation: 47
If I run the code in the Javascript Console of an browser such as Chrome:
function foo() {
function bar() {
console.trace();
}
bar();
}
foo();
The result will be:
bar
foo
(anonymous function)
The console.trace()
may trace to 'global scope' at the end. I know the global in the browser is the window
object. But what is the specific function that (anonymous function)
points to in the result?
Upvotes: 1
Views: 858
Reputation: 23642
Its expecting an anonymous
function as argument
.
function Vinoth(){console.log("Vinoth")}
undefined
console.trace(Vinoth());
VM129:1 Vinoth
More info on this link: https://github.com/DeveloperToolsWG/console-object/blob/master/api.md#consoletraceobject--object-
Upvotes: 1