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
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Can you explain this JavaScript to me in your source code?
I never saw that you can call something that is eighter a variable or a function, why not
Also is this library usable for React? Or only Vanilla JS?
Thanks
A reference to function is being stored in observerNode[selector] and
pop
is being used to get that reference and store intocb
(callback) hence when you callcb
it actually calls that function. And yes it is a very valid syntax in JavaScript.I have only tested it fir Vanilla JS