theJava
theJava

Reputation: 15034

Cannot call method toUpperCase of undefined

if (json.ScheduleCareProviderScheduledPatientsGetResult.Appointments[i].Patient.Firstname.toUpperCase().indexOf(searchBarValue.toUpperCase()) == 0) {

Why do i get this error.

Upvotes: 1

Views: 4957

Answers (2)

Simon Dufour
Simon Dufour

Reputation: 184

Either json.ScheduleCareProviderScheduledPatientsGetResult.Appointments[i].Patient.Firstname or searchBarValue are undefined. Make sure they're not null before you call this line!

Upvotes: 2

Felix
Felix

Reputation: 89566

Because

json.ScheduleCareProviderScheduledPatientsGetResult.Appointments[i].Patient.Firstname

is undefined.

Upvotes: 2

Related Questions