Situation
I was performing some maintenance on JS.
And a certain function put a return
in the middle of it, because the rest was no longer necessary.
In seeing the comment on the rest or delete, I kept the code there.
When reloading the page the console launches this message:
SyntaxError: unreachable code after return statement
Syntax error: unreachable code after return statement
Code
function ajustaTela(){
jQuery('.data').datepick();
return;
if(jQuery(document).innerWidth() < 1050){
jQuery("#panel-header #panel-header-content #menu_header li").css({'padding':'6px 5px'});
}else{
jQuery("#panel-header #panel-header-content #menu_header li").css({'padding':'6px 10px'});
}
jQuery('span.adicionar_favoritos').css('margin-left', ((jQuery('span.adicionar_favoritos').parents('div.panel_title').width() / 2)-15) + 'px');
jQuery('.data').datepick();
makeHeaderFixedSize();
}
Doubt
What possible problems can I have in maintaining a code after return
?
Obs
Browser: firefox 40.0