Answer To Your Question So what is $ (function () { });? Now that you know that $ is the name of the function, if you are using the jQuery library, then you are calling the function named $ and passing the argument function() {} into it. The jQuery library will call the function at the appropriate time. When is the appropriate time? According to jQuery documentation, the appropriate time is ...
javascript - What does $ (function () {} ); do? - Stack Overflow
What these functions do is that when the function is defined, The function is immediately called, which saves time and extra lines of code (as compared to calling it on a seperate line).
What is the (function () { } ) () construct in JavaScript?
12 The function* type looks like it acts as a generator function for processes that can be iterated. C# has a feature like this using "yield return" see 1 and see 2 Essentially this returns each value one by one to whatever is iterating this function, which is why their use case shows it in a foreach style loop.
Actually, the above function will be treated as function expression without a name. The main purpose of wrapping a function with close and open parenthesis is to avoid polluting the global space.
I don't think we should downgrade. mgt.clearMarks is not a function seems more like the tool that clears the TODO list. Let's wait for the update.
Note that there’s no semicolon; this is just a function declaration. You would need an invocation, foo(), to actually run the function. Now, when we add the seemingly innocuous exclamation mark: !function foo() {} it turns it into an expression. It is now a function expression. The ! alone doesn’t invoke the function, of course, but we can now put () at the end: !function foo() {}(), which ...