I would say since scripts are often concatenated and minified/compressed/sent together there's a chance the last guy had something like:
(我会说因为脚本经常连接和缩小/压缩/一起发送,所以最后一个人有可能有这样的事情:)
return {
'var':'value'
}
at the end of the last script without a ;
(在最后一个脚本的末尾没有;
)
on the end.(最后。)
If you have a ;
(如果你有;
)
at the start on yours, it's safe, example:(在你的开始,它是安全的,例如:)
return {
'var':'value'
}
;(function( $ ){ //Safe (still, screw you, last guy!)
return {
'var':'value'
}
(function( $ ){ //Oh crap, closure open, kaboom!
return {
'var':'value'
};
;(function( $ ){ //Extra ;, still safe, no harm
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…