SocialPilot interview question

how javascript event driven work