DEV Community

Discussion on: "Let me wait-for-it and call you back", said wait-for-it.js

Collapse
 
cstayyab profile image
Muhammad Tayyab Sheikh • Edited

A reference to function is being stored in observerNode[selector] and pop is being used to get that reference and store into cb (callback) hence when you call cb it actually calls that function. And yes it is a very valid syntax in JavaScript.

I have only tested it fir Vanilla JS