Reputation: 830
Web browsers have different features and some browsers support console api depending on version.
Among the apis, I wonder whether console.log invokes javascript engine or browser internal functions. Actually, I ran js test code which includes console.log("") for debug ging in Android.
"console.log" invokes function(s) in v8 or android browser application on dalvik? Seemingly, console.log is js code, but console object is supported by web browser.
That's why I'm confused.
Also, could you point some location in android source tree to understand its function call mechanism?
Thanks!
Upvotes: 2
Views: 330
Reputation: 887443
console.log()
is a native function – a function implemented by the host that is exposed to Javascript.
All DOM methods are also native functions.
You can see this from console.log.toString()
, which returns "function log() { [native code] }"
.
Upvotes: 3