javascript - Parse Uncaught TypeError: Cannot read property 'get' of undefined -


this code:

var images = new parse.query("images"); var bunny_data = [];  images.equalto("indeximg","t"); images.find({     success: function(objects) {         for(var = 0;i<=objects.length;i++){             var object =  objects[i];             object.get('imgurl');          };     },     error: function(error) {         console.log("an error occured :(");     } }); console.log(bunny_data); 

the console is:

[]
myjs.js:65 uncaught typeerror: cannot read property 'get' of undefined

for(var = 0;i<=objects.length;i++){ 

the <= means loops 0 objects.length inclusive, length exclusive upper bound on array’s indices. use < instead.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -