I know JavaScript is single threaded non blocking, and hands things such as setTimeout() to the web api, but how does it handle scopes?
lets say there is a function like
function example()
{
const x = 10
setTimeout(() => { console.log(x) }), 100)
}
example()
How does it keep track of the variables in that scope? or do they not get deleted?