Skip to content
Advertisement

‘currentApple’ is already defined showing in jslint

I have have some js code; in that I ran the js lint. I have this error:

‘currentApple’ is already defined

Do I need to remove var currentApple from else to make it work?

I’m providing my code below:

if(appleTab == Lifeline){
    var currentApple = appleWorklist.getcurrentAppleTime("currentAppointmentcurrentAppleTime");
    fo.allApples = currentApple;
}
else
{
    var currentApple = appleWorklist.getcurrentAppleTime("CalendarcurrentAppointmentcurrentAppleTime");
    fo.allApples = currentApple;
}

Advertisement

Answer

var currentApple;
if (appleTab == Lifeline) {
    currentApple = /* etc. */
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement