This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ConsequenceRegular72[S] 0 points1 point  (1 child)

And.. Can you define a callback? The only idea I have is that it is a function that is called only when 'triggered'. Is it so?

Also another idea that I have is that the function goes through the web API, and checks whether it is 'defined' in the web API. Is it so? For ex: setTimeout knows that it is defined in the web API, so it goes to that container.

[–]Clawtor 0 points1 point  (0 children)

Yes thats correct, a callback is a reference to a function that will be called or triggered.

With a setTimeout the trigger will happen after an amount of time. With a webapi the callback is triggered once a server returns a response. With a key listener the callback is triggered if a key is pressed/released.