Saya ingin menambahkan Array objek pribadi di bikash. Ini kode saya.. tolong bantu saya..!!!

const people=[{
 bikash:[{
    name:'Bikash',
    surName:'Khadka',
    address:'Chabahil',
  }],
}]

people[0].bikash.push(personal[{
  occupation: 'insteuctor',
  hobbie: 'FootBall',
}])
console.log(people);
0
Karma Dorje Tamang 20 September 2019, 15:54

1 menjawab

Jawaban Terbaik

People didefinisikan sebagai const, ubah menjadi let

let people=[{bikash:[{ name:'Bikash', surName:'Khadka', address:'Chabahil'}]}];
people[0].bikash[0].personal = [{ occupation: 'insteuctor', hobbie: 'FootBall'}];
0
s1ja 20 September 2019, 13:02