var logins:Array = []; if(so.data.logins != [] && (so.data.logins as Array).length < 5 ) arr.push(new Log()); so.data.logins = arr;