27
rated 0 times
[
34]
[
7]
/ answers: 1 / hits: 23342
/ 13 Years ago, wed, january 18, 2012, 12:00:00
I need to replace imagesrc with the value stored in this object. However when I run:
if(data['results'][res]['entities']['media'][0][media_url]) {
imagesrc = data['results'][res]['entities']['media'][0][media_url];
}
I get the error:
Cannot read property '0' of undefined
How can I run my condition so that I don't get errors if something is undefined?
More From » javascript