0

I am watching a course where the professor mentions a local execution context being created every time we execute a function created by ourselves (he does not says exactly that, however he does not mentions this when he explains external functions like setTimeOut or fetch). However what happens when we call an external function (like setTimeOut or fetch) does javascript creates a local execution context for this functions too? What I mean by external functions is functions not created by ourself but part of an API.

1 Answer 1

2

Most external functions for javascript are actually written in C, so they don't have a javascript execution context per se. However, they still have a stack frame, which is similar to what a javascript execution context is.

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

2 Comments

So for example when I call setTimeOut this function has nothing to do with javascript but is only an api for triggering a timer in the browser and because is the browser that will execute the timer it's there where the execution context (stack frame) is created?
Browsers implement the setTimeout function, usually in C, which doesn't have javascript's execution contexts.

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.