My implementation is such that i have :
var test = [{},{},{}];
My test var is an array of objects. In this the last object can be empty or have keys.
I need to remove this last object always if it is empty.
What i have written right now works and its thus :
var lengthofTest = test.length;
if(Object.keys(test[lengthofTest]).length == 0) {
test.pop();
}
Is there a better way of doing it? Anything more direct?