Added Later: I want to add further clarification on my concern. My concern is un-minified code without semicolon works. But what about absence of semicolon in minified code (which is in single line)? because it indicates END of the statement.
I have also gone through the answers of this question https://stackoverflow.com/questions/5840845/reliable-and-convenient-javascript-minifier#=
I have also gone through stephenwlther link.
But still my concern is not resolved. Because minifier tools removes semicolons from lot of lines.
Check this un-minified code...
(jQuery)(function ($) {
function statsCount(options) {
var $this = $(this);
options = $.extend({}, options || {}, $this.data('countToOptions') || {});
$this.countTo(options);
} // NUMBERS COUNTER END
function statsAnimate() {
// NUMBERS COUNTER START
$('.numbers').data('countToOptions', {
formatter: function (value, options) {
return value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, ',');
}
});
// start timer
$('.timer').each(statsCount);
}
if (typeof (CMA) != "undefined" && CMA.elementsAnimation) {
$('.numbers-counter').waypoint(function () {
statsAnimate();
},
{offset: '70%'}
);
} else {
statsAnimate();
}
});
minifier.org giving me below code....
(jQuery)(function($){function statsCount(options){var $this=$(this);options=$.extend({},options||{},$this.data('countToOptions')||});$this.countTo(options)}function statsAnimate()$('.numbers').data('countToOptions',formatter:function(value,options){return value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g,',')}});$('.timer').each(statsCount)}if(typeof(CMA)!="undefined"&&CMA.elementsAnimation){$('.numbers-counter').waypoint(function()statsAnimate()},offset:'70%'})}else{statsAnimate()}})
Note the absence of semicolon at the end and from lot of places.
If this correct??