Jump to content

TypeError - Driving me insane - why why why


wongadob
 Share

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

Edited by wongadob
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()			  });

Edited by wongadob
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...