//3 person var a = new Object(); a.name=""; a.surname=""; var b = new Object(); b.name=""; b.surname=""; var c = new Object(); c.name=""; c.surname=""; //different fileds a.patronymic=""; a.collorHair=''; a.sex=''; b.collorSkin=''; b.gender=''; b.presenceOfChildren=''; c.collorEyes=''; c.nationality=''; c.footSize=''; //fileds check for ( let boobSyzze in a ) { if( boobSyzze != "name" || boobSyzze != "surname" || boobSyzze != "patronymic" || boobSyzze != "collorHair" || boobSyzze != "sex" ); alert(boobSyzze); } for ( let boobSyzze in b ) { if( boobSyzze != "name" || boobSyzze != "surname" || boobSyzze != "collorSkin" || boobSyzze != "gender" || boobSyzze != "presenceOfChildren" ); alert(boobSyzze); } for ( let boobSyzze in c ) { if( boobSyzze != "name" || boobSyzze != "surname" || boobSyzze != "collorEyes" || boobSyzze != "nationality" || boobSyzze != "footSize" ); alert(boobSyzze); } //array of persons let persons =[{}, {}, {}]; for (let key of persons){ key.name = 'Mary'; key.surname = 'Jain'; key.familyDoctor = 'dr.Dre'; } //loop of persons for (let key of persons) { console.log(key);} //loop of name and surname; for (let key in persons){ console.log(persons[key].name); console.log(persons[key].surname); } // loop of loop of values; persons.forEach(function(keyOfPersone){ for (let key in keyOfPersone){ console.log(keyOfPersone[key]); } }); //full name persons.forEach(function(fullN){ let counter = 0; for (let key in fullN){ if (key==='name') counter++; } if (counter >= 1) { fullN.fullname = "Mary Jain"; } }) //serialize let serialize = JSON.stringify(persons); console.log(serialize); //deserialize let deserialize = JSON.parse('{"name": "2pac", "surname": "shakur", "familyDoctor":"Orlando Anderson", "fullName":"Lesane Parish Crooks"}'); persons.push(deserialize); //HTML var str = '
${persons[i][key]} | `; } str += '