2

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!

2

1 Answer 1

3

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] }".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.