DEV Community


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

cstayyab profile image
Muhammad Tayyab Sheikh Author • 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