In bootstrap JS (I checked version 3.2.0) some function definitions have a plus sign at first and 'use strict'; in the following:
+function ($) { 'use strict'; ... } 'Use strictly'; as I guess is AMD definition syntax maybe. Can someone explain about this syntax and meaning and where is better to use this pattern? Thanks.
UPDATE: It seems the + sign (Or any arbitrary unary operator) uses to turn the function declaration into an expression. Check here for more info: https://stackoverflow.com/a/11897575/332420
+function(){}().use stricthas nothing to do with AMD, see here developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…+function($){}non sensical. The plus+, or any other unary operators will do+function(){}(), ~function(){}(), !function(){}(), ...