Skip to content Skip to sidebar Skip to footer

Jquery Accessing Array Index

Trying to access index values of an array in a function. The array has 4 records however only index 1 - 3 values is being accessed the last value in the array is not being accessed

Solution 1:

Your code is not easy to understand, but your callback is sometimes returning undefined and sometimes a function, perhaps this causes the TypeError, since you could potentially be returning undefined when the API expects a function... this is only a guess though...

Indexing into the array was wrong, your variable i took on values from 1 - 3, when i became 4 you were indexing outside the array, thus you got a TypeError, indexing into the array should start from 0.

Post a Comment for "Jquery Accessing Array Index"