I'm struggling to understand what I'm doing wrong here.
I have an empty object:
if ( doc._attachments === undefined ){
doc._attachments = {};
}
var attmtid = 123;
which I'm trying to populate like so:
doc._attachments[attmtid].revpos = "abc";
However I keep getting an undefined error from Firebug:
doc._attachments[attmtid] is undefined
And can't really make any sense of it.
Question:
Can someone tell me what I'm doing wrong?
Thanks!