From the below javascript sample
try {
if(jsVar) {
proceed();
}
}catch(e){
alert(e);
}
this jsVar is declared and initialed in another js fine.
The problem is that code throws undefined error when this code is executed before the other file (where its declared and initiated) is executed. That is why it is surrounded by try and catch.
Whats the best way to handle this undefined error than try catch?