Skip to content

Why to use callback functions when I can simply call them?

I was reading about callback functions here (also in an online course which I am participating) and now I am stuck. The reason is that I cannot understand Why do I need to use callback functions if I can simply call them. Exemples below: 1 – Using callback functions: 2 – Here is my code not using …

Define getter using defineProperty

In our application we compress our JavaScript classes using UglifyJS which doesn’t support being able to compress syntax like onBlur = (event) => {} as it returns Unexpected token: operator (=). To solve this problem we have used the following function to define them: And then we use it inside our co…