mercredi 1 février 2017

Javascript ELSE error

This is maddening. I have the following javascript:

var ut = "";    
for (var i = 0; i < Rows.length; i++ ) {
        if (i === 0) {
                    ut = "Overwrite";
                } else {
                    ut = "Update";
                }
    }

Throwing this error:

Exception of type 'Jint.Native.JsException' was thrown.

But when I empty the else statement it does not throw the error.

var ut = "";    
for (var i = 0; i < Rows.length; i++ ) {
            if (i === 0) {
                        ut = "Overwrite";
                    } else {
                    }
        }

What would cause this?

Aucun commentaire:

Enregistrer un commentaire