Answer the question
In order to leave comments, you need to log in
Why in Twitter Bootstrap + before function declarations?
Hello!
Looked at Twitter Bootstrap sources, got to bootstrap.js. What surprised me was the use of the "+" sign before declaring anonymous functions. In addition, the entire code is stubbed "use strict", and there are few places after the operators with a semicolon.
Actually, two questions:
- why is there a "+" sign?
- why do developers almost never use a semicolon after assignment, function calls and return statements? Is this good JS programming practice?
Answer the question
In order to leave comments, you need to log in
It is clear from the article that this is another way of declaring a self-calling function. A very interesting approach.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question