I was working on a project that involves using pre-loaded data. The goal of this part is to remove an object from json as such:
var obj = {'objectName0':[object0, object1, object], 'objectName1':[object, object, object], 'objectName2':[object, object, object]}
I'd usually delete an object from it like this:
delete obj[Object.keys(obj)[i]];
The problem however is that I will be looping through it later on using
obj[data[i]].length,
and as we all know this will return "undefined".
another thing that I'd like to note that when I'm trying to remove this object, I do NOT know it's name, that's why I'm using Object.keys();