I have the following:
var a = {
"message":"The request is invalid.",
"modelState":{
"model.ConfirmPassword":["The password and confirmation password do not match."]
}
}
var keys = a.modelState.keys;
var firstError = a.modelState[keys[0]];
I would like to have the variable firstError set to "The password and confirmation password do not match."
However it is giving me "Cannot read property '0' of undefined".