Jump to content

TypeError - Driving me insane - why why why


wongadob

Recommended Posts

I have an object defined called feed. I have these two lines of code

console.log (feed);console.log (feed['notifications']);var notes = feed.notifications.length-1;

In Chrome debugger I am getting this - Object is feed [ Object

  • meta: Array[0]
  • notifications: Array[0]
  • objects: Array[0]
  • references: Array[0]
  • __proto__: Object

] main.js:1714</p>undefined main.js:1715

  • Uncaught TypeError: Cannot read property 'length' of undefined

Link to comment
Share on other sites

I have tried using the combinations of .notifications and ['notifications'] I believe they are interchangeable, but I have tried all combinations and still I am getting this. It is really doing my head in as I cannot see anything wrong. Anybody know any reason why this might be happening

Link to comment
Share on other sites

BTW this is where the array/object is created. Note that NoteCache is passed to this function as feed

var noteCache=new Array();noteCache.push({notifications: new Array(),references: new Array(),objects: new Array(),meta: new Array()			  });

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...